Skip to content

Enable building Python packages for PyPI distribution #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
527ca7a
Add the capability to build Python (PyPI) packages directly.
dralley Jun 21, 2018
4311a8e
cmake: Support building libcreaterepo_c statically
jcfr Jul 29, 2018
1227830
cmake: Include OPENSSL_INCLUDE_DIR to support building against custom…
jcfr Jul 29, 2018
6f77806
cmake: Ensure _createrepo_c is weakly linked against python library i…
jcfr Jul 29, 2018
a4eee6b
setup.py: Set BUILD_LIBCREATEREPO_C_SHARED to OFF
jcfr Jul 29, 2018
e47a89a
setup.py: Fix egg_info build error updating mapping of package to sou…
jcfr Jul 29, 2018
9280ebe
Build and distribute the binaries, too.
dralley Jul 30, 2018
fe5a306
setup.py: Set ENABLE_BASHCOMP option instead of checking for SKBUILD
jcfr Jul 30, 2018
717b965
cmake: Introduce CREATEREPO_C_INSTALL_MANPAGES option
jcfr Jul 30, 2018
399975f
cmake: Introduce CREATEREPO_C_INSTALL_DEVELOPMENT option
jcfr Jul 30, 2018
cdf910c
cmake: Introduce BIN_INSTALL_DIR to allow customization of executable…
jcfr Jul 30, 2018
56eb1ca
setup.py: Add entrypoints for each repo_c executable
jcfr Jul 30, 2018
3b67fc3
Add requirements-dev.txt
jcfr Jul 30, 2018
58a4505
setup.py: Support building against Python 2 and Python 3
jcfr Jul 30, 2018
e804553
Change conditionals a bit
dralley Jul 30, 2018
8c90040
Add this block back, it's necessary for non-python builds
dralley Jul 30, 2018
9b5b5f2
Bump minimum required cmake to 2.8
dralley Jul 31, 2018
bf5b805
Move Python __init__.py into src/python/createrepo_c
dralley Jul 31, 2018
7f1fb86
Fix __init__.py when used in a non-Python package context
dralley Jul 31, 2018
85a8615
Remove complicated logic for handling editable installs
dralley Aug 2, 2018
5d6c5e9
Add code to setup.py to parse version from VERSION.cmake
dralley Aug 2, 2018
c018c70
README snippet
dralley Aug 2, 2018
5a87e04
Use splitlines() instead of split()
dralley Aug 9, 2018
0cb6fc4
Python bindings don't support deltarpm; disable it
dralley Aug 25, 2018
fe04253
Fix package metadata
dralley Sep 16, 2018
2f71436
Utilize GNUInstallDirs
dralley Sep 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
*_wrap.c
snippets/

# Binary files
mergerepo_c
createrepo_c
modifyrepo_c
sqliterepo_c

# Packages and tarball
createrepo*.rpm
python-createrepo*.rpm
Expand All @@ -28,6 +22,13 @@ _CPack_Packages/
src/version.h
src/createrepo_c.pc
src/deltarpms.h
src/python/createrepo_c/
_skbuild/

# Python distribution stuff
dist/
MANIFEST
*.egg-info/

# Devel stuff
notes
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Jarek Polok <[email protected]>
Neal Gompa <[email protected]>
Ralph Bean <[email protected]>
Frank Schreiner <[email protected]>
Daniel Alley <[email protected]>
42 changes: 27 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT (createrepo_c C)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -ggdb -g -Wall -Wextra -Og")
Expand All @@ -14,6 +14,14 @@ IF(CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL "DEBUG")
ENDIF()


option(BUILD_LIBCREATEREPO_C_SHARED "Build libcreaterepo_c as a shared library" ON)
if(NOT BUILD_LIBCREATEREPO_C_SHARED)
set(CMAKE_POSITION_INDEPENDENT_CODE 1)
endif()

option(CREATEREPO_C_INSTALL_DEVELOPMENT "Install createrepo_c development files." ON)
option(CREATEREPO_C_INSTALL_MANPAGES "Install createrepo_c man-pages." ON)

# Add path with own cmake modules

INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR})
Expand All @@ -39,6 +47,7 @@ find_package(ZLIB REQUIRED)

include_directories(${GLIB2_INCLUDE_DIRS})
include_directories(${LIBXML2_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIR})


IF (RPM_PATH)
Expand Down Expand Up @@ -126,20 +135,23 @@ endif()

# Other files

pkg_check_modules(BASHCOMP bash-completion)
if (BASHCOMP_FOUND)
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=completionsdir bash-completion OUTPUT_VARIABLE BASHCOMP_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
message("Bash completion directory: ${BASHCOMP_DIR}")
INSTALL(FILES createrepo_c.bash DESTINATION ${BASHCOMP_DIR} RENAME createrepo_c)
INSTALL(CODE "
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink createrepo_c \$ENV{DESTDIR}${BASHCOMP_DIR}/mergerepo_c)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink createrepo_c \$ENV{DESTDIR}${BASHCOMP_DIR}/modifyrepo_c)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink createrepo_c \$ENV{DESTDIR}${BASHCOMP_DIR}/sqliterepo_c)
")
ELSE (BASHCOMP_FOUND)
INSTALL(FILES createrepo_c.bash DESTINATION "/etc/bash_completion.d")
message("Bash completion directory: /etc/bash_completion.d")
endif (BASHCOMP_FOUND)
OPTION(ENABLE_BASHCOMP "Install Bash autocompletions?" ON)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're being verbose for the other options, should this be named CREATEREPO_C_INSTALL_BASHCOMP to be more consistent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Ideally, option specific to the project should be prefixed by the project name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this could be done in a different PR along with some other stylistic changes

IF (ENABLE_BASHCOMP)
pkg_check_modules(BASHCOMP bash-completion)
IF (BASHCOMP_FOUND)
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=completionsdir bash-completion OUTPUT_VARIABLE BASHCOMP_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
message("Bash completion directory: ${BASHCOMP_DIR}")
INSTALL(FILES createrepo_c.bash DESTINATION ${BASHCOMP_DIR} RENAME createrepo_c)
INSTALL(CODE "
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink createrepo_c \$ENV{DESTDIR}${BASHCOMP_DIR}/mergerepo_c)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink createrepo_c \$ENV{DESTDIR}${BASHCOMP_DIR}/modifyrepo_c)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink createrepo_c \$ENV{DESTDIR}${BASHCOMP_DIR}/sqliterepo_c)
")
ELSEIF (BASHCOMP_FOUND)
INSTALL(FILES createrepo_c.bash DESTINATION "/etc/bash_completion.d")
message("Bash completion directory: /etc/bash_completion.d")
ENDIF (BASHCOMP_FOUND)
ENDIF (ENABLE_BASHCOMP)


# Gen manpage
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,31 @@ cause degradation of performance.

Without git revision specified HEAD is used.

## Build Python package

To create a binary "wheel" distribution, use:

python setup.py bdist_wheel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should suggest the pip way instead:

pip wheel . -w dist

Copy link
Contributor Author

@dralley dralley Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any specific benefits? I've not seen this way before, but according to stack overflow and github issues, it can be fairly slow because it copies everything into a temp directory before doing the build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving forward, the idea is to build python package using a standard approach that is independent from the build backend. The fact setuptools is used in an implementation details and we should try to move away from it, ideally i think the user experience should be the same for building wheels.

The other advantage is that it keeps the source tree clean of any artifact.

Timing wise, here is quick comparison for this project

$ mkvirtualenv -p python3.5 createrepo_c-pip-wheel

$ time pip wheel . -w dist --no-cache-dir
real	0m5.113s
user	0m13.332s
sys	0m1.104s
$ mkvirtualenv -p python3.5 createrepo_c-setup-bdist-wheel

$ time bash -c "pip install -r requirements-dev.txt && python setup.py bdist_wheel"
real	0m3.947s
user	0m11.996s
sys	0m1.180s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair points. The only objection I have is that w/ Pip v9 (which is what is currently installed on most distributions, including the newest Fedora and Ubuntu), you would also have to install the wheel package because that functionality isn't included by default. It looks like Pip v10+ does include it however.

I would probably err on the side of consistency, so if there's an analogous pip command for building sdists, we can use those. But otherwise I would probably stick with the "standard" way for now and update it later on.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if there's an analogous pip command for building sdists

No

I would probably stick with the "standard" way for now and update it later on.

Agreed.


To create a source distribution, use:

python setup.py sdist

Installing source distributions require the installer of the package to have all of the build dependencies installed on their system, since they compile the code during installation. Binary distributions are pre-compiled, but they are likely not portable between substantially different systems, e.g. Fedora and Ubuntu.

Note: if you are building a bdist or installing the sdist on a system with an older version of Pip, you may need to install the ```scikit-build``` Python package first.

To install either of these packages, use:

pip install dist/{{ package name }}

To create an "editable" install of createrepo_c, use:

python setup.py develop

Note: To recompile the libraries and binaries, you muse re-run this command.


## Build RPM package

Modify createrepo_c.spec and run:
Expand Down
8 changes: 5 additions & 3 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ if(DOXYGEN_FOUND)
COMMENT "Building C API documentation with Doxygen" VERBATIM)
endif(DOXYGEN_FOUND)

INSTALL(FILES createrepo_c.8 mergerepo_c.8 modifyrepo_c.8 sqliterepo_c.8
DESTINATION share/man/man8
COMPONENT bin)
IF(CREATEREPO_C_INSTALL_MANPAGES)
INSTALL(FILES createrepo_c.8 mergerepo_c.8 modifyrepo_c.8 sqliterepo_c.8
DESTINATION share/man/man8
COMPONENT bin)
ENDIF(CREATEREPO_C_INSTALL_MANPAGES)

ADD_CUSTOM_TARGET (doc)
ADD_DEPENDENCIES (doc doc-python doc-c)
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "scikit-build"]
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setuptools
wheel
scikit-build
58 changes: 58 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from skbuild import setup


with open('VERSION.cmake', 'r+') as version_file:
lines = version_file.read().splitlines()
# parse out digit characters from the line, convert to int
numbers = [int("".join(filter(str.isdigit, line))) for line in lines]
Copy link
Contributor Author

@dralley dralley Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially be done "better" with regex, but I'm pretty weak with regex, and I think it's valid to assume there won't be numeric characters on each line that aren't part of the actual version number.

But I'm open to suggestions on how to do this better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it would be a pure python package, I would suggest to use python-versioneer

But in the case of createrepo_c, the project can be built either as a standalone project or python package, the version management needs to be available to both.

For now, I suggest to stick with your approach. Later after we standardize approaches like the one done here, this could be revisited.

# build version string
version = '{major}.{minor}.{patch}'.format(
major=numbers[0],
minor=numbers[1],
patch=numbers[2]
)

setup(
name='createrepo_c',
description='C implementation of createrepo',
version=version,
license='GPLv2',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is GPLv2+

author='RPM Software Management',
author_email='',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email address is [email protected]

url='https://github.com/rpm-software-management',
classifiers=(
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Topic :: System :: Software Distribution',
'Topic :: System :: Systems Administration',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
),
packages=['createrepo_c'],
package_dir={
'createrepo_c': 'src/python/createrepo_c'
},
cmake_args=[
'-DBIN_INSTALL_DIR:PATH=src/python/createrepo_c/data/bin',
'-DBUILD_LIBCREATEREPO_C_SHARED:BOOL=OFF',
'-DCREATEREPO_C_INSTALL_DEVELOPMENT:BOOL=OFF',
'-DCREATEREPO_C_INSTALL_MANPAGES:BOOL=OFF',
'-DENABLE_BASHCOMP:BOOL=OFF',
'-DENABLE_DRPM:BOOL=OFF'
],
cmake_languages=['C'],
entry_points={
'console_scripts': [
'createrepo_c=createrepo_c:createrepo_c',
'mergerepo_c=createrepo_c:mergerepo_c',
'modifyrepo_c=createrepo_c:modifyrepo_c',
'sqliterepo_c=createrepo_c:sqliterepo_c'
]
},
)
41 changes: 32 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ SET(headers
xml_file.h
xml_parser.h)

ADD_LIBRARY(libcreaterepo_c SHARED ${createrepo_c_SRCS})
IF (BUILD_LIBCREATEREPO_C_SHARED)
SET (createrepo_c_library_type SHARED)
ELSE ()
SET (createrepo_c_library_type STATIC)
ENDIF ()
ADD_LIBRARY(libcreaterepo_c ${createrepo_c_library_type} ${createrepo_c_SRCS})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${BZIP2_LIBRARIES})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${CURL_LIBRARY})
TARGET_LINK_LIBRARIES(libcreaterepo_c ${EXPAT_LIBRARIES})
Expand Down Expand Up @@ -110,16 +115,34 @@ CONFIGURE_FILE("deltarpms.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/deltarpms.h" @ONLY)
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET (LIB_SUFFIX "64")
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")

SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just go ahead and change this to use GNUInstallDirs? We're already saying we require at least CMake 2.8, right?

IF (CREATEREPO_C_INSTALL_DEVELOPMENT OR "${createrepo_c_library_type}" STREQUAL "SHARED")
INSTALL(
TARGETS libcreaterepo_c
RUNTIME DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT Development
)
ENDIF (CREATEREPO_C_INSTALL_DEVELOPMENT OR "${createrepo_c_library_type}" STREQUAL "SHARED")

IF (CREATEREPO_C_INSTALL_DEVELOPMENT)
INSTALL(FILES ${headers} DESTINATION "include/createrepo_c")
INSTALL(FILES "createrepo_c.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
ENDIF (CREATEREPO_C_INSTALL_DEVELOPMENT)

INSTALL(FILES ${headers} DESTINATION "include/createrepo_c")
INSTALL(FILES "createrepo_c.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
INSTALL(TARGETS libcreaterepo_c LIBRARY DESTINATION ${LIB_INSTALL_DIR})
INSTALL(TARGETS createrepo_c DESTINATION bin/)
INSTALL(TARGETS mergerepo_c DESTINATION bin/)
INSTALL(TARGETS modifyrepo_c DESTINATION bin/)
INSTALL(TARGETS sqliterepo_c DESTINATION bin/)
IF (NOT DEFINED BIN_INSTALL_DIR)
SET(BIN_INSTALL_DIR "bin/")
ENDIF (NOT DEFINED BIN_INSTALL_DIR)
INSTALL(
TARGETS
createrepo_c
mergerepo_c
modifyrepo_c
sqliterepo_c
RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime
)

IF (ENABLE_PYTHON)
ADD_SUBDIRECTORY(python)
ADD_SUBDIRECTORY(python)
ENDIF (ENABLE_PYTHON)
69 changes: 40 additions & 29 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
if (${PYTHON_DESIRED} STREQUAL "2")
unset(PYTHON_LIBRARY)
unset(PYTHON_INCLUDE_DIR)
unset(PYTHON_EXECUTABLE)
unset(PYTHON_LIBRARY CACHE)
unset(PYTHON_INCLUDE_DIR CACHE)
unset(PYTHON_EXECUTABLE CACHE)
FIND_PACKAGE(PythonLibs 2)
FIND_PACKAGE(PythonInterp 2 REQUIRED)
else()
SET(Python_ADDITIONAL_VERSIONS 3.0)
unset(PYTHON_LIBRARY)
unset(PYTHON_INCLUDE_DIR)
unset(PYTHON_EXECUTABLE)
unset(PYTHON_LIBRARY CACHE)
unset(PYTHON_INCLUDE_DIR CACHE)
unset(PYTHON_EXECUTABLE CACHE)
FIND_PACKAGE(PythonLibs 3.0)
FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
endif()
if (NOT SKBUILD)
if (${PYTHON_DESIRED} STREQUAL "2")
unset(PYTHON_LIBRARY)
unset(PYTHON_INCLUDE_DIR)
unset(PYTHON_EXECUTABLE)
unset(PYTHON_LIBRARY CACHE)
unset(PYTHON_INCLUDE_DIR CACHE)
unset(PYTHON_EXECUTABLE CACHE)
FIND_PACKAGE(PythonLibs 2)
FIND_PACKAGE(PythonInterp 2 REQUIRED)
else ()
SET(Python_ADDITIONAL_VERSIONS 3.0)
unset(PYTHON_LIBRARY)
unset(PYTHON_INCLUDE_DIR)
unset(PYTHON_EXECUTABLE)
unset(PYTHON_LIBRARY CACHE)
unset(PYTHON_INCLUDE_DIR CACHE)
unset(PYTHON_EXECUTABLE CACHE)
FIND_PACKAGE(PythonLibs 3.0)
FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
endif ()
endif (NOT SKBUILD)

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
Expand All @@ -28,12 +30,6 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-strict-aliasing")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-strict-aliasing")

IF (${CMAKE_VERSION} VERSION_LESS "2.8.0")
CONFIGURE_FILE(__init__.py "src/python/createrepo_c/__init__.py" COPYONLY)
ELSE()
FILE(COPY __init__.py DESTINATION ./createrepo_c/)
ENDIF()

SET (createrepo_cmodule_SRCS
checksum-py.c
compression_wrapper-py.c
Expand Down Expand Up @@ -66,8 +62,23 @@ TARGET_LINK_LIBRARIES(_createrepo_c libcreaterepo_c)
TARGET_LINK_LIBRARIES(_createrepo_c
${EXPAT_LIBRARIES}
${CURL_LIBRARY}
${PYTHON_LIBRARY}
)

INSTALL(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/createrepo_c)
INSTALL(TARGETS _createrepo_c LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/createrepo_c)
IF (SKBUILD)
find_package(PythonExtensions REQUIRED)
python_extension_module(_createrepo_c)
ELSE ()
TARGET_LINK_LIBRARIES(_createrepo_c ${PYTHON_LIBRARY})
ENDIF ()

IF (NOT SKBUILD)
FILE(COPY createrepo_c/__init__.py DESTINATION createrepo_c)
ENDIF()

IF (SKBUILD)
INSTALL(FILES createrepo_c/__init__.py DESTINATION src/python/createrepo_c)
INSTALL(TARGETS _createrepo_c LIBRARY DESTINATION src/python/createrepo_c)
ELSE ()
INSTALL(FILES createrepo_c/__init__.py DESTINATION ${PYTHON_INSTALL_DIR}/createrepo_c)
INSTALL(TARGETS _createrepo_c LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/createrepo_c)
ENDIF ()
Loading