From 998749b2a5eae8c65345cd975dffc8270523fd74 Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Thu, 18 Sep 2014 16:40:40 +0200 Subject: [PATCH] replace hardpath with rpm macro - increase yocto compliance - improve rpmlint score - remove bashism Change-Id: I057d9ed746d905a5fa69b83c90fdd3810be8ab5d Signed-off-by: Ronan Le Martret --- packaging/security-server.spec | 105 +++++++++++++++++++++-------------------- systemd/CMakeLists.txt | 2 +- 2 files changed, 55 insertions(+), 52 deletions(-) diff --git a/packaging/security-server.spec b/packaging/security-server.spec index ccc85ae..e9552ff 100644 --- a/packaging/security-server.spec +++ b/packaging/security-server.spec @@ -68,59 +68,63 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" %endif -export LDFLAGS+="-Wl,--rpath=%{_libdir}" +export LDFLAGS="${LDFLAGS} -Wl,--rpath=%{_libdir}" %cmake . -DVERSION=%{version} \ - -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \ - -DCMAKE_VERBOSE_MAKEFILE=ON -make %{?jobs:-j%jobs} + -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DSYSTEMD_DIR=%{_unitdir} + +%__make %{?_smp_mflags} %install rm -rf %{buildroot} -mkdir -p %{buildroot}/usr/share/license -cp LICENSE %{buildroot}/usr/share/license/%{name} -cp LICENSE %{buildroot}/usr/share/license/libsecurity-server-client -mkdir -p %{buildroot}/etc/security/ -cp security-server-audit.conf %{buildroot}/etc/security/ +mkdir -p %{buildroot}%{_datadir}/license +cp LICENSE %{buildroot}%{_datadir}/license/%{name} +cp LICENSE %{buildroot}%{_datadir}/license/libsecurity-server-client +mkdir -p %{buildroot}%{_sysconfdir}/security/ +cp security-server-audit.conf %{buildroot}%{_sysconfdir}/security/ %make_install -mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants -mkdir -p %{buildroot}/usr/lib/systemd/system/sockets.target.wants -ln -s ../security-server.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/security-server.service -ln -s ../security-server-data-share.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-data-share.socket -ln -s ../security-server-get-gid.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-get-gid.socket -ln -s ../security-server-privilege-by-pid.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-privilege-by-pid.socket -ln -s ../security-server-cookie-get.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-cookie-get.socket -ln -s ../security-server-cookie-check.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-cookie-check.socket -ln -s ../security-server-app-privilege-by-name.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-app-privilege-by-name.socket -ln -s ../security-server-password-check.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-password-check.socket -ln -s ../security-server-password-set.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-password-set.socket -ln -s ../security-server-password-reset.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/security-server-password-reset.socket +mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants +mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants +ln -s ../security-server.service %{buildroot}%{_unitdir}/multi-user.target.wants/security-server.service +ln -s ../security-server-data-share.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-data-share.socket +ln -s ../security-server-get-gid.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-get-gid.socket +ln -s ../security-server-privilege-by-pid.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-privilege-by-pid.socket +ln -s ../security-server-cookie-get.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-cookie-get.socket +ln -s ../security-server-cookie-check.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-cookie-check.socket +ln -s ../security-server-app-privilege-by-name.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-app-privilege-by-name.socket +ln -s ../security-server-password-check.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-password-check.socket +ln -s ../security-server-password-set.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-password-set.socket +ln -s ../security-server-password-reset.socket %{buildroot}%{_unitdir}/sockets.target.wants/security-server-password-reset.socket %clean rm -rf %{buildroot} %post +ldconfig systemctl daemon-reload if [ $1 = 1 ]; then - # installation +# installation systemctl start security-server.service fi if [ $1 = 2 ]; then - # update +# update systemctl restart security-server.service fi %preun if [ $1 = 0 ]; then - # unistall +# unistall systemctl stop security-server.service fi -%postun +%postun +ldconfig if [ $1 = 0 ]; then - # unistall +# unistall systemctl daemon-reload fi @@ -131,31 +135,30 @@ fi %files -n security-server %manifest security-server.manifest %defattr(-,root,root,-) -%attr(755,root,root) /usr/bin/security-server +%attr(755,root,root) %{_bindir}/security-server %{_libdir}/libsecurity-server-commons.so.* -%attr(-,root,root) /usr/lib/systemd/system/multi-user.target.wants/security-server.service -%attr(-,root,root) /usr/lib/systemd/system/security-server.service -%attr(-,root,root) /usr/lib/systemd/system/security-server.target -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-data-share.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-data-share.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-get-gid.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-get-gid.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-privilege-by-pid.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-privilege-by-pid.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-cookie-get.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-cookie-get.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-cookie-check.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-cookie-check.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-app-privilege-by-name.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-app-privilege-by-name.socket -%attr(-,root,root) /etc/security/security-server-audit.conf -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-password-check.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-password-check.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-password-set.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-password-set.socket -%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/security-server-password-reset.socket -%attr(-,root,root) /usr/lib/systemd/system/security-server-password-reset.socket - +%attr(-,root,root) %{_unitdir}/multi-user.target.wants/security-server.service +%attr(-,root,root) %{_unitdir}/security-server.service +%attr(-,root,root) %{_unitdir}/security-server.target +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-data-share.socket +%attr(-,root,root) %{_unitdir}/security-server-data-share.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-get-gid.socket +%attr(-,root,root) %{_unitdir}/security-server-get-gid.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-privilege-by-pid.socket +%attr(-,root,root) %{_unitdir}/security-server-privilege-by-pid.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-cookie-get.socket +%attr(-,root,root) %{_unitdir}/security-server-cookie-get.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-cookie-check.socket +%attr(-,root,root) %{_unitdir}/security-server-cookie-check.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-app-privilege-by-name.socket +%attr(-,root,root) %{_unitdir}/security-server-app-privilege-by-name.socket +%config %attr(-,root,root) %{_sysconfdir}/security/security-server-audit.conf +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-password-check.socket +%attr(-,root,root) %{_unitdir}/security-server-password-check.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-password-set.socket +%attr(-,root,root) %{_unitdir}/security-server-password-set.socket +%attr(-,root,root) %{_unitdir}/sockets.target.wants/security-server-password-reset.socket +%attr(-,root,root) %{_unitdir}/security-server-password-reset.socket %{_datadir}/license/%{name} %files -n libsecurity-server-client @@ -169,5 +172,5 @@ fi %defattr(-,root,root,-) %{_libdir}/libsecurity-server-client.so %{_libdir}/libsecurity-server-commons.so -/usr/include/security-server/security-server.h +%{_includedir}/security-server/security-server.h %{_libdir}/pkgconfig/*.pc diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt index 52d95a5..197e74c 100644 --- a/systemd/CMakeLists.txt +++ b/systemd/CMakeLists.txt @@ -11,6 +11,6 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/systemd/security-server-password-check.socket ${CMAKE_SOURCE_DIR}/systemd/security-server-password-set.socket DESTINATION - /usr/lib/systemd/system + ${SYSTEMD_DIR} ) -- 2.7.4