2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2023 Marcel Telka
16 %patch% 01-test-disable-failing.patch
17 %patch% 02-test-proxy.patch
20 # Force setup.py build style because we need to pass additional --openssl-dir
21 # and there seems to be no way how to do that with the default pyproject build
23 BUILD_STYLE = setup.py
25 # Install common files to /usr
26 PYTHON_DATA = $(USRDIR)
28 # Make sure we compile and link with proper openssl version
29 LDFLAGS += -L$(OPENSSL_LIBDIR)
30 LDFLAGS += -R$(OPENSSL_LIBDIR)
31 COMPONENT_BUILD_SETUP_PY_ARGS += --openssl-dir=$(OPENSSL_PREFIX)
33 # Rename pycurl documentation to contain version number
34 COMPONENT_POST_INSTALL_ACTION += \
35 $(MV) $(PROTOUSRSHAREDOCDIR)/pycurl $(PROTOUSRSHAREDOCDIR)/pycurl-$(PYTHON_VERSION) ;
37 # Compile extra libraries for tests
38 COMPONENT_PRE_TEST_ACTION += PATH=$(PATH.gnu) make -C $(@D)/tests/fake-curl/libcurl ;
40 # https://github.com/pycurl/pycurl/issues/876
41 PYTEST_ADDOPTS += --deselect tests/pause_test.py::PauseTest::test_pause_via_call
42 PYTEST_ADDOPTS += --deselect tests/pause_test.py::PauseTest::test_pause_via_return
44 # Replace Python version in pycurl documentation directory name
45 GENERATE_EXTRA_CMD += | \
46 $(GSED) -e 's/\(usr\/share\/doc\/pycurl-\)3\.[0-9]*/\1$$(PYVER)/' | uniq
48 # ... and create mediated symlink for it.
49 printf '\nlink path=usr/share/doc/pycurl target=pycurl-$(PYVER) mediator=python mediator-version=$(PYVER)\n' >> "$DISTRIBUTION-PYVER.p5m"
53 cat "$SOURCE_DIR//README.rst" | gsed -e '0,/^License/d' -n -e '/^ /,${/^[^ ]/,$d ; s/^ // ; p}'
54 printf '\n--- COPYING-LGPL ----------------------------------------------------------\n\n'
55 cat "$SOURCE_DIR/COPYING-LGPL"
56 printf '\n\n--- COPYING-MIT -----------------------------------------------------------\n\n'
57 cat "$SOURCE_DIR/COPYING-MIT"
58 ) > "$DISTRIBUTION.license"
59 sed -i -e '/^COMPONENT_LICENSE_FILE/d' Makefile
60 git add "$DISTRIBUTION.license"
62 detect_license LICENSE "$DISTRIBUTION.license"
63 gsed -i -e 's/^\(COMPONENT_LICENSE =\t*\)[^\t]*$/\1'"$LICENSE"'/' Makefile