[packages/astyle] - updated to 3.1, build libraries

qboosh qboosh at pld-linux.org
Fri Apr 19 22:54:56 CEST 2019


commit 696559a506e76a8eda85004bf8cea7ace902a8b8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Apr 19 22:55:08 2019 +0200

    - updated to 3.1, build libraries

 astyle.spec | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 85 insertions(+), 9 deletions(-)
---
diff --git a/astyle.spec b/astyle.spec
index aee32af..ec6bfe5 100644
--- a/astyle.spec
+++ b/astyle.spec
@@ -1,13 +1,19 @@
+#
+# Conditional build:
+%bcond_without	java		# Java library
+%bcond_without	static_libs	# static library
+
 Summary:	Automatic Indentation Filter
 Summary(pl.UTF-8):	Automatyczny filtr wcięć
 Name:		astyle
-Version:	2.02
+Version:	3.1
 Release:	1
-License:	GPL v2
+License:	MIT
 Group:		Development/Tools
 Source0:	http://downloads.sourceforge.net/astyle/%{name}_%{version}_linux.tar.gz
-# Source0-md5:	6ce1f5c766ba142f152dab4ddd1ee3b7
+# Source0-md5:	7712622f62661b1d8cb1062d7fedc390
 URL:		http://astyle.sourceforge.net/
+%{?with_java:BuildRequires:	jdk}
 BuildRequires:	libstdc++-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -19,11 +25,47 @@ source code.
 Artistic Style to narzędzie do reformatowania kodu z poprawianiem
 wcięć dla źródeł w C++, C i Javie.
 
+%package java
+Summary:	AStyle library for Java
+Summary(pl.UTF-8):	Biblioteka AStyle dla Javy
+Group:		Libraries
+
+%description java
+AStyle library for Java.
+
+%description java -l pl.UTF-8
+Biblioteka AStyle dla Javy.
+
+%package devel
+Summary:	Header file for AStyle library
+Summary(pl.UTF-8):	Plik nagłówkowy biblioteki AStyle
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	libstdc++-devel
+
+%description devel
+Header file for AStyle library.
+
+%description devel -l pl.UTF-8
+Plik nagłówkowy biblioteki AStyle.
+
+%package static
+Summary:	Static AStyle library
+Summary(pl.UTF-8):	Statyczna biblioteka AStyle
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static AStyle library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka AStyle.
+
 %prep
 %setup -q -n %{name}
 
 %build
-%{__make} -C build/gcc \
+%{__make} -C build/gcc astyle shared %{?with_static_libs:static} %{?with_java:java} \
 	CXX="%{__cxx}" \
 	CPPFLAGS="%{rpmcflags}"
 
@@ -34,14 +76,48 @@ rm -rf $RPM_BUILD_ROOT
 	INSTALL=install \
 	prefix=$RPM_BUILD_ROOT%{_prefix}
 
-# docdir fixed
-mkdir  $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}/
-mv $RPM_BUILD_ROOT/%{_docdir}/%{name}/html/*.html $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}/
+install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
+install build/gcc/bin/libastyle.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
+ln -sf $(basename build/gcc/bin/libastyle.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libastyle.so
+%if %{with java}
+install build/gcc/bin/libastylej.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
+ln -sf $(basename build/gcc/bin/libastylej.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libastylej.so
+%endif
+%if %{with static_libs}
+cp -p build/gcc/bin/libastyle.a $RPM_BUILD_ROOT%{_libdir}
+%endif
+cp -p src/astyle.h $RPM_BUILD_ROOT%{_includedir}
+
+/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
+
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc doc/*.html doc/*.css
-%attr(755,root,root) %{_bindir}/*
+%doc LICENSE.md README.md doc/{*.html,*.css}
+%attr(755,root,root) %{_bindir}/astyle
+%attr(755,root,root) %{_libdir}/libastyle.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libastyle.so.3
+
+%if %{with java}
+%files java
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libastylej.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libastylej.so.3
+%attr(755,root,root) %{_libdir}/libastylej.so
+%endif
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libastyle.so
+%{_includedir}/astyle.h
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libastyle.a
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/astyle.git/commitdiff/696559a506e76a8eda85004bf8cea7ace902a8b8



More information about the pld-cvs-commit mailing list