!1 Init package
From: @misaka00251 Reviewed-by: @panchenbo Signed-off-by: @panchenbo
This commit is contained in:
commit
981819db3b
11
astyle-html-help.patch
Normal file
11
astyle-html-help.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- a/src/astyle_main.cpp 2017-09-24 11:46:50.008331032 +0200
|
||||||
|
+++ b/src/astyle_main.cpp 2017-09-24 11:47:05.826623047 +0200
|
||||||
|
@@ -1314,7 +1314,7 @@
|
||||||
|
void ASConsole::launchDefaultBrowser(const char* filePathIn /*nullptr*/) const
|
||||||
|
{
|
||||||
|
struct stat statbuf;
|
||||||
|
- string htmlDefaultPath = "/usr/share/doc/astyle/html/";
|
||||||
|
+ string htmlDefaultPath = "/usr/share/doc/astyle/";
|
||||||
|
string htmlDefaultFile = "astyle.html";
|
||||||
|
|
||||||
|
// build file path
|
||||||
13
astyle-r655-gcc8-vector-at-end.patch
Normal file
13
astyle-r655-gcc8-vector-at-end.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Index: AStyle/src/astyle_main.cpp
|
||||||
|
===================================================================
|
||||||
|
--- AStyle/src/astyle_main.cpp (revision 655)
|
||||||
|
+++ AStyle/src/astyle_main.cpp (working copy)
|
||||||
|
@@ -1347,7 +1347,7 @@ void ASConsole::getFileNames(const string& directo
|
||||||
|
|
||||||
|
// sort the current entries for fileName
|
||||||
|
if (firstEntry < fileName.size())
|
||||||
|
- sort(&fileName[firstEntry], &fileName[fileName.size()]);
|
||||||
|
+ sort(fileName.begin() + firstEntry, fileName.end());
|
||||||
|
|
||||||
|
// recurse into sub directories
|
||||||
|
// if not doing recursive, subDirectory is empty
|
||||||
77
astyle.spec
Normal file
77
astyle.spec
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
Name: astyle
|
||||||
|
Version: 3.1
|
||||||
|
Release: 1
|
||||||
|
Summary: Source code formatter for C-like programming languages
|
||||||
|
|
||||||
|
%global majorversion 3
|
||||||
|
%global soversion 3.1.0
|
||||||
|
|
||||||
|
License: LGPLv3+
|
||||||
|
URL: http://astyle.sourceforge.net/
|
||||||
|
Source0: https://downloads.sourceforge.net/%{name}/%{name}_%{version}_linux.tar.gz
|
||||||
|
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
|
||||||
|
Patch1: astyle-html-help.patch
|
||||||
|
Patch2: astyle-r655-gcc8-vector-at-end.patch
|
||||||
|
|
||||||
|
%description
|
||||||
|
Artistic Style is a source code indenter, source code formatter, and
|
||||||
|
source code beautifier for the C, C++, C# and Java programming
|
||||||
|
languages.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Source code formatter for C-like programming languages
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
Artistic Style is a source code indenter, source code formatter, and
|
||||||
|
source code beautifier for the C, C++, C# and Java programming
|
||||||
|
languages.
|
||||||
|
|
||||||
|
This package contains the shared library.
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{name}
|
||||||
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
|
find . -type f -exec chmod a-x {} \;
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
pushd src
|
||||||
|
# fix compling instead of patching the makefile.
|
||||||
|
g++ %{build_cxxflags} -DASTYLE_LIB -fPIC -c ASBeautifier.cpp ASEnhancer.cpp ASFormatter.cpp ASResource.cpp astyle_main.cpp
|
||||||
|
g++ %{build_ldflags} -shared -o libastyle.so.%{soversion} *.o -Wl,-soname,libastyle.so.%{majorversion}
|
||||||
|
ln -s libastyle.so.%{soversion} libastyle.so
|
||||||
|
g++ %{build_cxxflags} -c ASLocalizer.cpp astyle_main.cpp
|
||||||
|
g++ %{build_ldflags} -o astyle ASLocalizer.o astyle_main.o -L. -lastyle
|
||||||
|
popd
|
||||||
|
|
||||||
|
%install
|
||||||
|
pushd src
|
||||||
|
mkdir -p %{buildroot}{%{_bindir},%{_libdir},%{_includedir}}
|
||||||
|
|
||||||
|
install -p -m 755 astyle %{buildroot}%{_bindir}
|
||||||
|
install -p -m 755 libastyle.so.%{soversion} %{buildroot}%{_libdir}
|
||||||
|
cp -P libastyle.so %{buildroot}%{_libdir}
|
||||||
|
install -p -m 644 astyle.h %{buildroot}%{_includedir}
|
||||||
|
popd
|
||||||
|
|
||||||
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
|
%files
|
||||||
|
%license LICENSE.md
|
||||||
|
%doc doc/*.html
|
||||||
|
%{_bindir}/astyle
|
||||||
|
%{_libdir}/libastyle.so.*
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%{_libdir}/libastyle.so
|
||||||
|
%{_includedir}/astyle.h
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Jul 20 2022 misaka00251 <misaka00251@misakanet.cn> - 3.1-1
|
||||||
|
- Init package
|
||||||
BIN
astyle_3.1_linux.tar.gz
Normal file
BIN
astyle_3.1_linux.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user