diff --git a/createrepo_c.changes b/createrepo_c.changes index bb78c9f..1b84a04 100644 --- a/createrepo_c.changes +++ b/createrepo_c.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 21 15:58:06 UTC 2018 - FSchreiner@suse.com + +- changed to provide createrepo as update-alternatives [bnc#1075670] +- also provide createrepo-implementation + ------------------------------------------------------------------- Sun Feb 19 12:57:21 UTC 2017 - ngompa13@gmail.com diff --git a/createrepo_c.spec b/createrepo_c.spec index 58dad9a..a482064 100644 --- a/createrepo_c.spec +++ b/createrepo_c.spec @@ -1,7 +1,7 @@ # # spec file for package createrepo_c # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2015-2017 Neal Gompa . # # All modifications and additions to the file contributed by third parties @@ -39,7 +39,7 @@ Name: createrepo_c Summary: Creates a common metadata repository -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/Packages Version: 0.10.0.git20170131.04828e6 Release: 0 @@ -80,6 +80,11 @@ BuildRequires: drpm-devel Requires: %{libname} = %{version}-%{release} +Requires(post): update-alternatives +Requires(postun): update-alternatives + +Provides: createrepo-implementation + # prevent provides from nonstandard paths: %global __provides_exclude ^(%{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so)$ @@ -167,6 +172,15 @@ make ARGS="-V" test -C py3/build %install %make_install -C build +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +ln -s -f %{_sysconfdir}/alternatives/createrepo %{buildroot}%{_bindir}/createrepo +ln -s -f %{_sysconfdir}/alternatives/mergerepo %{buildroot}%{_bindir}/mergerepo +ln -s -f %{_sysconfdir}/alternatives/modifyrepo %{buildroot}%{_bindir}/modifyrepo +ln -s -f %{_sysconfdir}/alternatives/sqliterepo %{buildroot}%{_bindir}/sqliterepo +ln -s -f %{_sysconfdir}/alternatives/createrepo.8.gz %{buildroot}%{_mandir}/man8/createrepo.8.gz +ln -s -f %{_sysconfdir}/alternatives/mergerepo.8.gz %{buildroot}%{_mandir}/man8/mergerepo.8.gz +ln -s -f %{_sysconfdir}/alternatives/modifyrepo.8.gz %{buildroot}%{_mandir}/man8/modifyrepo.8.gz +ln -s -f %{_sysconfdir}/alternatives/sqliterepo.8.gz %{buildroot}%{_mandir}/man8/sqliterepo.8.gz %if %{with python} %if %{with python3} @@ -175,29 +189,67 @@ make ARGS="-V" test -C py3/build %endif %fdupes %{buildroot}%{_prefix} +%fdupes build/doc/html +%clean +exit 0 + +%post +update-alternatives --install \ + %{_bindir}/createrepo createrepo %{_bindir}/createrepo_c 20 \ + --slave %{_bindir}/mergerepo mergerepo %{_bindir}/mergerepo_c \ + --slave %{_bindir}/modifyrepo modifyrepo %{_bindir}/modifyrepo_c \ + --slave %{_bindir}/sqliterepo sqliterepo %{_bindir}/sqliterepo_c \ + --slave %{_mandir}/man8/createrepo.8.gz createrepo.8.gz %{_mandir}/man8/createrepo_c.8.gz \ + --slave %{_mandir}/man8/mergerepo.8.gz mergerepo.8.gz %{_mandir}/man8/mergerepo_c.8.gz \ + --slave %{_mandir}/man8/modifyrepo.8.gz modifyrepo.8.gz %{_mandir}/man8/modifyrepo_c.8.gz \ + --slave %{_mandir}/man8/sqliterepo.8.gz sqliterepo.8.gz %{_mandir}/man8/sqliterepo_c.8.gz + +%postun +if [ ! -f %{_bindir}/createrepo_c ];then + update-alternatives --remove createrepo %{_bindir}/createrepo_c +fi %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %files +%defattr(-,root,root) %doc README.md COPYING %{_mandir}/man8/createrepo_c.8* %{_mandir}/man8/mergerepo_c.8* %{_mandir}/man8/modifyrepo_c.8* %{_mandir}/man8/sqliterepo_c.8* +%{_mandir}/man8/createrepo.8* +%{_mandir}/man8/mergerepo.8* +%{_mandir}/man8/modifyrepo.8* +%{_mandir}/man8/sqliterepo.8* %{_datadir}/bash-completion/completions/ %{_bindir}/createrepo_c %{_bindir}/mergerepo_c %{_bindir}/modifyrepo_c %{_bindir}/sqliterepo_c +%{_bindir}/createrepo +%{_bindir}/mergerepo +%{_bindir}/modifyrepo +%{_bindir}/sqliterepo +%ghost %_sysconfdir/alternatives/createrepo +%ghost %_sysconfdir/alternatives/mergerepo +%ghost %_sysconfdir/alternatives/modifyrepo +%ghost %_sysconfdir/alternatives/sqliterepo +%ghost %_sysconfdir/alternatives/createrepo.8.gz +%ghost %_sysconfdir/alternatives/mergerepo.8.gz +%ghost %_sysconfdir/alternatives/modifyrepo.8.gz +%ghost %_sysconfdir/alternatives/sqliterepo.8.gz %files -n %{libname} +%defattr(-,root,root) %doc COPYING %{_libdir}/libcreaterepo_c.so.%{major} %{_libdir}/libcreaterepo_c.so.%{major}.* %files -n %{devname} +%defattr(-,root,root) %doc build/doc/html COPYING %{_libdir}/libcreaterepo_c.so %{_libdir}/pkgconfig/createrepo_c.pc @@ -205,11 +257,13 @@ make ARGS="-V" test -C py3/build %if %{with python} %files -n python2-%{name} +%defattr(-,root,root) %doc COPYING %{python_sitearch}/createrepo_c/ %if %{with python3} %files -n python3-%{name} +%defattr(-,root,root) %doc COPYING %{python3_sitearch}/createrepo_c/ %endif