Skip to content

Commit

Permalink
Keep tdnf spec in alignment with Photon's spec
Browse files Browse the repository at this point in the history
Remove autoinstall related instructions, they are obsolete now.

Signed-off-by: Shreenidhi Shedi <[email protected]>
  • Loading branch information
sshedi committed Dec 11, 2024
1 parent 39a9507 commit ad497b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion scripts/build-tdnf-rpms.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mkdir -p "${rpm_build_path}"/{SOURCES,BUILD,RPMS/"${arch}"}
mv -f "${full_name}".tar.gz "${rpm_build_path}"/SOURCES

dist=$(rpm -q glibc | cut -d'.' -f3)
rpmbuild --nodeps -D "dist .${dist}" -D "_topdir ${rpm_build_path}" -bb "${project_name}".spec
rpmbuild --nocheck -D "dist .${dist}" -D "_topdir ${rpm_build_path}" -bb "${project_name}".spec

mkdir -p ${rpmdir}
mv -f "${rpm_build_path}"/RPMS/"${arch}"/*.rpm ${rpmdir}
Expand Down
28 changes: 9 additions & 19 deletions tdnf.spec.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
%define hist_db_dir %{_libdir}/sysimage/%{name}
%define history_db_fn %{hist_db_dir}/history.db
%define history_autoins %{_sharedstatedir}/%{name}/autoinstalled
%define history_util %{_libexecdir}/%{name}/%{name}-history-util
%define _tdnfpluginsdir %{_libdir}/%{name}-plugins

Expand Down Expand Up @@ -143,43 +142,36 @@ Requires: %{name} = %{version}-%{release}
Systemd units that can periodically download package upgrades and apply them.

%prep
%autosetup -p1 -n %{name}-%{version}
%autosetup -p1

%build
mkdir -p build
pushd build
cmake \
%{cmake} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DSYSTEMD_DIR=%{_unitdir} \
..

%make_build
%make_build python
popd
%{cmake_build}
%make_build -C %{__cmake_builddir} python

%install
pushd build
%make_install %{?_smp_mflags}
popd
%{cmake_install}

mkdir -p %{buildroot}{%{_var}/cache/%{name},%{_unitdir}}
ln -sv %{name} %{buildroot}%{_bindir}/tyum
ln -sv %{name} %{buildroot}%{_bindir}/yum
ln -sv %{name} %{buildroot}%{_bindir}/tdnfj

pushd build/python
python3 setup.py install --skip-build --prefix=%{_prefix} --install-lib=%{python3_sitelib} --root=%{buildroot}
pushd %{__cmake_builddir}/python
%py3_install
popd

find %{buildroot} \( -name '*.a' -o -name '*.pyc' \) -delete

%if 0%{?with_check}
%check
pip3 install flake8
%make_build -C build check
%endif
%make_build -C %{__cmake_builddir} check

%post
/sbin/ldconfig
Expand All @@ -192,9 +184,7 @@ pip3 install flake8
# cannot use tdnf because that is still running even in postrans
[ -d %{hist_db_dir} ] || mkdir -p %{hist_db_dir}
[ -f %{history_db_fn} ] || %{history_util} init
[ ! -f %{history_autoins} ] || exit 0
%{history_util} mark remove $(cat %{history_autoins})
mv %{history_autoins} %{history_autoins}.backup
exit 0

%triggerin -- motd
[ $2 -eq 1 ] || exit 0
Expand Down

0 comments on commit ad497b9

Please sign in to comment.