Skip to content

Commit

Permalink
plugins: move plugin search dir one level up
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverkurth committed Dec 1, 2022
1 parent 7121dcc commit 130ffa4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
3 changes: 1 addition & 2 deletions client/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,8 @@ _TDNFLoadPluginLibs(
}
dwError = TDNFAllocateStringPrintf(
&pszPlugin,
"%s/%s/lib%s.so",
"%s/lib%s.so",
pszLibPath,
pPlugin->pszName,
pPlugin->pszName);
BAIL_ON_TDNF_ERROR(dwError);

Expand Down
2 changes: 1 addition & 1 deletion plugins/metalink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ target_link_libraries(${PROJECT_NAME}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/lib/${PROJECT_NAME})
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/lib)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/tdnf-plugins)
4 changes: 3 additions & 1 deletion plugins/metalink/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ TDNFXmlParseData(
BAIL_ON_TDNF_ERROR(dwError);
}
}
TDNFXmlParseData(ml_ctx, node->children, filename);
if (node->children) {
TDNFXmlParseData(ml_ctx, node->children, filename);
}
node = node->next;
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/repogpgcheck/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ target_link_libraries(${PROJECT_NAME}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/lib/${PROJECT_NAME})
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/lib)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/tdnf-plugins)
23 changes: 9 additions & 14 deletions tdnf.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DSYSTEMD_DIR=%{_unitdir} \
..

Expand All @@ -130,15 +130,10 @@ cd build && make %{?_smp_mflags} check
%install
cd build && make DESTDIR=%{buildroot} install %{?_smp_mflags}
find %{buildroot} -name '*.a' -delete
mkdir -p %{buildroot}/var/cache/tdnf %{buildroot}%{_unitdir}
ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/tyum
ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/yum
ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/tdnfj
mv %{buildroot}%{_libdir}/pkgconfig/tdnfcli.pc %{buildroot}%{_libdir}/pkgconfig/tdnf-cli-libs.pc
mkdir -p %{buildroot}%{_tdnfpluginsdir}/tdnfmetalink
mkdir -p %{buildroot}%{_tdnfpluginsdir}/tdnfrepogpgcheck
mv %{buildroot}%{_tdnfpluginsdir}/libtdnfmetalink.so %{buildroot}%{_tdnfpluginsdir}/tdnfmetalink/
mv %{buildroot}%{_tdnfpluginsdir}/libtdnfrepogpgcheck.so %{buildroot}%{_tdnfpluginsdir}/tdnfrepogpgcheck/
mkdir -p %{buildroot}/var/cache/%{name} %{buildroot}%{_unitdir}
ln -sfv %{name} %{buildroot}%{_bindir}/tyum
ln -sfv %{name} %{buildroot}%{_bindir}/yum
ln -sfv %{name} %{buildroot}%{_bindir}/tdnfj

pushd python
python3 setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
Expand Down Expand Up @@ -235,13 +230,13 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
%defattr(-,root,root)
%dir %{_sysconfdir}/tdnf/pluginconf.d
%config(noreplace) %{_sysconfdir}/tdnf/pluginconf.d/tdnfmetalink.conf
%{_tdnfpluginsdir}/tdnfmetalink/libtdnfmetalink.so
%{_tdnfpluginsdir}/libtdnfmetalink.so

%files plugin-repogpgcheck
%defattr(-,root,root)
%dir %{_sysconfdir}/tdnf/pluginconf.d
%config(noreplace) %{_sysconfdir}/tdnf/pluginconf.d/tdnfrepogpgcheck.conf
%{_tdnfpluginsdir}/tdnfrepogpgcheck/libtdnfrepogpgcheck.so
%dir %{_sysconfdir}/%{name}/pluginconf.d
%config(noreplace) %{_sysconfdir}/%{name}/pluginconf.d/tdnfrepogpgcheck.conf
%{_tdnfpluginsdir}/libtdnfrepogpgcheck.so

%files python
%defattr(-,root,root)
Expand Down
6 changes: 3 additions & 3 deletions tools/cli/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# configure pkgconfig file
configure_file(
tdnfcli.pc.in
tdnfcli.pc @ONLY
tdnf-cli-libs.pc.in
tdnf-cli-libs.pc @ONLY
)

add_library(${LIB_TDNF_CLI} SHARED
Expand Down Expand Up @@ -38,5 +38,5 @@ set_target_properties(${LIB_TDNF_CLI} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB_TDNF_CLI}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tdnf-cli-libs.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(TARGETS ${LIB_TDNF_CLI} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library)
File renamed without changes.

0 comments on commit 130ffa4

Please sign in to comment.