diff --git a/astyle-html-help.patch b/astyle-html-help.patch new file mode 100644 index 0000000..34f3640 --- /dev/null +++ b/astyle-html-help.patch @@ -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 diff --git a/astyle-r655-gcc8-vector-at-end.patch b/astyle-r655-gcc8-vector-at-end.patch new file mode 100644 index 0000000..040bbb5 --- /dev/null +++ b/astyle-r655-gcc8-vector-at-end.patch @@ -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 diff --git a/astyle.spec b/astyle.spec new file mode 100644 index 0000000..c40805e --- /dev/null +++ b/astyle.spec @@ -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 - 3.1-1 +- Init package diff --git a/astyle_3.1_linux.tar.gz b/astyle_3.1_linux.tar.gz new file mode 100644 index 0000000..eabb019 Binary files /dev/null and b/astyle_3.1_linux.tar.gz differ