Skip to content

Commit

Permalink
Revise drpm dependency check and bump the minimum version to 0.3.0
Browse files Browse the repository at this point in the history
Since we now use the functionality from drpm to create DeltaRPMs,
we need to update the dependency check accordingly.

Also, drpm has long since ceased to be an experimental dependency,
so stop marking it as such.

Finally, update the README with the correct information about
DeltaRPM support.
  • Loading branch information
Conan-Kudo committed Aug 6, 2019
1 parent d65f9bc commit 4e23919
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 39 deletions.
21 changes: 3 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,9 @@ ENDIF (ENABLE_LEGACY_WEAKDEPS)
# drpm
OPTION (ENABLE_DRPM "Enable delta RPM support?" ON)
IF (ENABLE_DRPM)
if (DRPM_PATH)
include_directories (${DRPM_PATH}/)
find_library (DRPM_LIBRARY NAMES drpm PATHS ${DRPM_PATH}/ NO_DEFAULT_PATH)
set(CR_DELTA_RPM_SUPPORT "1")
message("Using custom DRPM: ${DRPM_LIBRARY}")
ELSE (DRPM_PATH)
FIND_LIBRARY (DRPM_LIBRARY NAMES drpm libdrpm.so.0)
IF (NOT DRPM_LIBRARY)
MESSAGE("No DRPM library installed")
ELSE (NOT DRPM_LIBRARY)
MESSAGE("Using DRPM library: ${DRPM_LIBRARY}")
set(CR_DELTA_RPM_SUPPORT "1")
ENDIF (NOT DRPM_LIBRARY)
endif (DRPM_PATH)

IF (CR_DELTA_RPM_SUPPORT)
ADD_DEFINITIONS("-DCR_DELTA_RPM_SUPPORT")
ENDIF (CR_DELTA_RPM_SUPPORT)
pkg_check_modules(DRPM REQUIRED drpm>=0.3.0)
include_directories (${DRPM_INCLUDE_DIRS})
ADD_DEFINITIONS("-DCR_DELTA_RPM_SUPPORT")
ENDIF (ENABLE_DRPM)

# option to enable/disable python support
Expand Down
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Package build requires - Pkg name in Fedora/Ubuntu:

* bzip2 (http://bzip.org/) - bzip2-devel/libbz2-dev
* cmake (http://www.cmake.org/) - cmake/cmake
* drpm (https://github.com/rpm-software-management/drpm) - drpm-devel/
* expat (http://expat.sourceforge.net/) - expat-devel/libexpat1-dev
* file (http://www.darwinsys.com/file/) - file-devel/libmagic-dev
* glib2 (http://developer.gnome.org/glib/) - glib2-devel/libglib2.0-dev
Expand All @@ -31,7 +32,6 @@ Package build requires - Pkg name in Fedora/Ubuntu:
* **Test requires:** python-nose (https://nose.readthedocs.org/) - python-nose/python-nose
* **Test requires:** xz (http://tukaani.org/xz/) - xz/
* **Test requires:** zchunk (https://github.com/zchunk/zchunk) - zchunk/
* **Experimental support:** drpm (https://github.com/rpm-software-management/drpm) - drpm-devel/

From your checkout dir:

Expand All @@ -52,7 +52,7 @@ To build the documentation, from the build/ directory:

E.g. when you want to try weak and rich dependencies.

cmake -DRPM_PATH="/home/tmlcoch/git/rpm" .. && make
cmake .. && make

**Note:** The RPM must be built in that directory

Expand All @@ -62,20 +62,6 @@ Commands I am using for building the RPM:
CPPFLAGS='-I/usr/include/nss3/ -I/usr/include/nspr4/' ./autogen.sh --rpmconfigure --with-vendor=redhat --with-external-db --with-lua --with-selinux --with-cap --with-acl --enable-python
make clean && make

## Building with delta rpm support (drpm)

At first, you have to checkout the drpm library from
https://github.com/rpm-software-management/drpm.git and build it.

git clone https://github.com/rpm-software-management/drpm.git
cd drpm/
make

Then run ``cmake`` for createrepo_c with param ``-DDRPM_PATH="/home/tmlcoch/git/drpm"``
where the path is path to your build of drpm library.

cmake -DDRPM_PATH="/home/tmlcoch/git/drpm" .. && make

## Building for a different Python version

By default, cmake should set up things to build for Python 3, but you can do a build for Python 2 like this::
Expand All @@ -99,6 +85,13 @@ and for most usecases doesn't bring any performance boost.
On regular hardware (e.g. less-or-equal 4 cores) this option may even
cause degradation of performance.

### ``-DENABLE_DRPM=ON``

Enable DeltaRPM support using drpm library (Default: ON)

Adds support for creating DeltaRPMs and incorporating them
into the repository.

### ``-DWITH_ZCHUNK=ON``

Build with zchunk support (Default: ON)
Expand Down
2 changes: 1 addition & 1 deletion createrepo_c.spec
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ BuildRequires: bash-completion
Requires: rpm >= 4.9.0
%endif
%if %{with drpm}
BuildRequires: drpm-devel >= 0.1.3
BuildRequires: drpm-devel >= 0.3.0
%endif

%if 0%{?fedora} || 0%{?rhel} > 7
Expand Down
5 changes: 1 addition & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ TARGET_LINK_LIBRARIES(libcreaterepo_c ${RPMDB_LIBRARY})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${SQLITE3_LIBRARIES})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${ZLIB_LIBRARY})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${ZCK_LIBRARIES})
IF (DRPM_LIBRARY)
TARGET_LINK_LIBRARIES(libcreaterepo_c ${DRPM_LIBRARY})
ENDIF (DRPM_LIBRARY)

TARGET_LINK_LIBRARIES(libcreaterepo_c ${DRPM_LIBRARIES})

SET_TARGET_PROPERTIES(libcreaterepo_c PROPERTIES
OUTPUT_NAME "createrepo_c"
Expand Down

0 comments on commit 4e23919

Please sign in to comment.