78 lines
2.1 KiB
RPMSpec
78 lines
2.1 KiB
RPMSpec
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
|