SPECS/tdnf/tdnf.spec
f4d17450
 #
 # tdnf spec file
 #
73c30986
 Summary:        dnf/yum equivalent using C libs
 Name:           tdnf
43f4efa2
 Version:        2.0.0
be3f75b4
 Release:        3%{?dist}
73c30986
 Vendor:         VMware, Inc.
 Distribution:   Photon
74242642
 License:        LGPLv2.1,GPLv2
e2df6df6
 URL:            http://www.vmware.com
73c30986
 Group:          Applications/RPM
74242642
 Requires:       rpm-libs
 Requires:       curl
43f4efa2
 Requires:       tdnf-cli-libs = %{version}-%{release}
 Requires:       libsolv
73c30986
 BuildRequires:  popt-devel
 BuildRequires:  rpm-devel
 BuildRequires:  openssl-devel
 BuildRequires:  libsolv-devel
74242642
 BuildRequires:  curl-devel
057385ab
 Obsoletes:      yum
 Provides:       yum
be3f75b4
 Source0:        %{name}-%{version}-beta.tar.gz
 %define sha1    tdnf=3d316ac465bef668f3deeda5b98c9a21c22e8323
057385ab
 Source1:        cache-updateinfo
 Source2:        cache-updateinfo.service
 Source3:        cache-updateinfo.timer
 Source4:        updateinfo.sh
43f4efa2
 Patch0:         tdnf-epoch-and-perm.patch
f4d17450
 
 %description
43f4efa2
 tdnf is a yum/dnf equivalent which uses libsolv and libcurl
f4d17450
 
73c30986
 %package    devel
 Summary:    A Library providing C API for tdnf
 Group:      Development/Libraries
 Requires:   tdnf = %{version}-%{release}
43f4efa2
 Requires:   libsolv-devel
f4d17450
 
 %description devel
 Development files for tdnf
 
74242642
 %package	cli-libs
 Summary:	Library providing cli libs for tdnf like clients
 Group:		Development/Libraries
 
 %description cli-libs
 Library providing cli libs for tdnf like clients.
 
f4d17450
 %prep
be3f75b4
 %setup -qn %{name}-%{version}-beta
3f523d80
 %patch0 -p1
f4d17450
 
 %build
fd510f31
 autoreconf -i
e2df6df6
 %configure \
74242642
     --disable-static
e5cb5105
 make %{?_smp_mflags}
f4d17450
 
 %install
 make DESTDIR=%{buildroot} install
74242642
 find %{buildroot} -name '*.la' -delete
f4d17450
 mkdir -p %{buildroot}/var/cache/tdnf
04e27de8
 ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/tyum
057385ab
 ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/yum
b24369bc
 install -v -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/tdnf-cache-updateinfo
 install -v -D -m 0644 %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/tdnf-cache-updateinfo.service
 install -v -D -m 0644 %{SOURCE3} %{buildroot}%{_libdir}/systemd/system/tdnf-cache-updateinfo.timer
 install -v -D -m 0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/motdgen.d/02-tdnf-updateinfo.sh
f4d17450
 
 # Pre-install
 %pre
 
     # First argument is 1 => New Installation
     # First argument is 2 => Upgrade
 
 # Post-install
 %post
 
     # First argument is 1 => New Installation
     # First argument is 2 => Upgrade
 
     /sbin/ldconfig
 
b24369bc
 %triggerin -- motd
 [ $2 -eq 1 ] || exit 0
 if [ $1 -eq 1 ]; then
a110b77e
     echo "detected install of tdnf/motd, enabling tdnf-cache-updateinfo.timer" >&2
b24369bc
     systemctl enable tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
     systemctl start tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
 elif [ $1 -eq 2 ]; then
a110b77e
     echo "detected upgrade of tdnf, daemon-reload" >&2
b24369bc
     systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 
 
f4d17450
 # Pre-uninstall
 %preun
 
     # First argument is 0 => Uninstall
     # First argument is 1 => Upgrade
 
b24369bc
 %triggerun -- motd
 [ $1 -eq 1 ] && [ $2 -eq 1 ] && exit 0
a110b77e
 echo "detected uninstall of tdnf/motd, disabling tdnf-cache-updateinfo.timer" >&2
b24369bc
 systemctl --no-reload disable tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
 systemctl stop tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
 rm -rf /var/cache/tdnf/cached-updateinfo.txt
 
f4d17450
 # Post-uninstall
 %postun
 
     /sbin/ldconfig
 
     # First argument is 0 => Uninstall
     # First argument is 1 => Upgrade
 
b24369bc
 %triggerpostun -- motd
 [ $1 -eq 1 ] && [ $2 -eq 1 ] || exit 0
a110b77e
 echo "detected upgrade of tdnf/motd, restarting tdnf-cache-updateinfo.timer" >&2
b24369bc
 systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
 
f4d17450
 %files
     %defattr(-,root,root,0755)
     %{_bindir}/tdnf
04e27de8
     %{_bindir}/tyum
057385ab
     %{_bindir}/yum
b24369bc
     %{_bindir}/tdnf-cache-updateinfo
43f4efa2
     %{_libdir}/libtdnf.so.*
3d094b4f
     %config(noreplace) %{_sysconfdir}/tdnf/tdnf.conf
b24369bc
     %config %{_libdir}/systemd/system/tdnf-cache-updateinfo.service
     %config(noreplace) %{_libdir}/systemd/system/tdnf-cache-updateinfo.timer
     %config %{_sysconfdir}/motdgen.d/02-tdnf-updateinfo.sh
f4d17450
     %dir /var/cache/tdnf
 
 %files devel
     %defattr(-,root,root)
04e27de8
     %{_includedir}/tdnf/*.h
43f4efa2
     %{_libdir}/libtdnf.so
     %{_libdir}/libtdnfcli.so
7c0bccc8
     %exclude %{_libdir}/debug
c9b8fd9b
     %{_libdir}/pkgconfig/tdnf.pc
74242642
     %{_libdir}/pkgconfig/tdnf-cli-libs.pc
 
 %files cli-libs
     %defattr(-,root,root)
     %{_libdir}/libtdnfcli.so.*
f4d17450
 
 %changelog
be3f75b4
 *   Wed Nov 21 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-3
 -   Update to 2.0.0 beta release.
e2df6df6
 *   Mon Oct 08 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-2
 -   Fix bug on tdnf crash when photon-iso repo only enabled without mounting cdrom.
43f4efa2
 *   Fri Feb 09 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.0.0-1
 -   update to 2.0.0
23d38389
 *   Tue Jan 30 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-3
 -   patch to error out early for permission issues.
3f523d80
 *   Tue Oct 10 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-2
 -   Fix bug in obsolete protected packages.
057385ab
 *   Wed Oct 4 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-1
 -   update to v1.2.2
919d9584
 *   Sat Sep 30 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-5
 -   Output problems while resolving to stderr (instead of stdout)
466b85f6
 *   Wed Sep 27 2017 Bo Gan <ganb@vmware.com> 1.2.1-4
 -   Improve suggestion in motd message
2217842d
 *   Thu Sep 14 2017 Bo Gan <ganb@vmware.com> 1.2.1-3
 -   Add suggestion in motd message
fdc023c3
 *   Fri Jul 21 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-2
 -   Modify quiet patch.
7bdfd47a
 *   Tue Jul 18 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-1
 -   Update to v1.2.1
663c891c
 *   Tue May 30 2017 Bo Gan <ganb@vmware.com> 1.2.0-5
 -   Fix cache-updateinfo script again
b4de5eb3
 *   Fri May 12 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.0-4
 -   Patch repo refresh to allow quiet flags
1dbbba5c
 *   Wed May 10 2017 Bo Gan <ganb@vmware.com> 1.2.0-3
 -   Fix cache-updateinfo script
29dd855c
 *   Fri May 05 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.0-2
 -   Fix Requires for cli-libs
74242642
 *   Wed May 03 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.0-1
 -   update to v1.2.0
a110b77e
 *   Sun Apr 30 2017 Bo Gan <ganb@vmware.com> 1.1.0-5
 -   Do not write to stdout in motd triggers
b24369bc
 *   Thu Apr 20 2017 Bo Gan <ganb@vmware.com> 1.1.0-4
 -   motd hooks/triggers for updateinfo notification
a7c2c480
 *   Fri Apr 14 2017 Dheerajs Shetty <dheerajs@vmware.com> 1.1.0-3
 -   Adding a patch to compile with latest hawkey version
73c30986
 *   Mon Dec 19 2016 Xiaolin Li <xiaolinl@vmware.com> 1.1.0-2
 -   BuildRequires libsolv-devel.
 *   Thu Dec 08 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.1.0-1
 -   update to v1.1.0
 *   Thu Nov 17 2016 Alexey Makhalov <amakhalov@vmware.com> 1.0.9-3
 -   Use rpm-libs at runtime
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.9-2
 -   GA - Bump release of all rpms
 *   Fri May 20 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.9-1
 -   Update to 1.0.9. Contains fixes for updateinfo.
 *   Wed May 4 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.8-3
 -   Fix link installs, fix devel header dir
 *   Fri Apr 1 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.8-2
 -   Update version which was missed with 1.0.8-1, apply string limits
 *   Fri Apr 1 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.8-1
 -   Code scan fixes, autotest path fix, support --releasever
 *   Thu Jan 14 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.7
 -   Fix return codes on install and check-update
 -   Add tests for install existing and update
 *   Wed Jan 13 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.6
 -   Support distroverpkg and add tests to work with make check
 *   Mon Dec 14 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.5
 -   Support for multiple packages in alter commands
 -   Support url vars for releasever and basearch
 *   Fri Oct 2 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.4
 -   Fix upgrade to work without args, Engage distro-sync
 -   Fix install to resolve to latest available
 -   Fix formats, fix refresh on download output
 *   Tue Sep 8 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.3
 -   Fix metadata creation issues. Engage refresh flag.
 -   Do not check gpgkey when gpgcheck is turned off in repo.
 *   Thu Jul 23 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.2
 -   Support reinstalls in transaction. Handle non-existent packages correctly.
 *   Mon Jul 13 2015 Alexey Makhalov <amakhalov@vmware.com> 1.0.1-2
 -   Create -debuginfo package. Use parallel make.
 *   Tue Jun 30 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.1
 -   Proxy support, keepcache fix, valgrind leaks fix
 *   Fri Jan 23 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0
 -   Initial build.  First version
f4d17450