]> git.pld-linux.org Git - packages/storj-uplink-c.git/commitdiff
- new master
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 12 Dec 2020 14:32:56 +0000 (15:32 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 12 Dec 2020 14:32:56 +0000 (15:32 +0100)
storj-uplink-c-libdir.patch [new file with mode: 0644]
storj-uplink-c.spec [new file with mode: 0644]

diff --git a/storj-uplink-c-libdir.patch b/storj-uplink-c-libdir.patch
new file mode 100644 (file)
index 0000000..2d51c07
--- /dev/null
@@ -0,0 +1,30 @@
+--- uplink-c-1.2.0/Makefile.orig       2020-12-04 17:39:34.000000000 +0100
++++ uplink-c-1.2.0/Makefile    2020-12-12 15:20:02.404070490 +0100
+@@ -2,7 +2,9 @@
+ SHELL ?= bash
+-DESTDIR ?= /usr/local
++DESTDIR ?=
++PREFIX ?= /usr/local
++LIBDIR ?= $(PREFIX)/lib
+ GPL2 ?= false
+ ifeq (${GPL2},true)
+@@ -62,10 +64,9 @@
+ .PHONY: install
+ install: build ## install library and headers
+       install -d \
+-              ${DESTDIR}/include/uplink \
+-              ${DESTDIR}/lib \
+-              ${DESTDIR}/lib/pkgconfig
+-      install .build/libuplink.so ${DESTDIR}/lib
+-      install .build/libuplink.a ${DESTDIR}/lib
+-      install -m 644 .build/uplink/* ${DESTDIR}/include/uplink
+-      install -m 644 .build/libuplink.pc ${DESTDIR}/lib/pkgconfig
++              ${DESTDIR}${PREFIX}/include/uplink \
++              ${DESTDIR}${LIBDIR}/pkgconfig
++      install .build/libuplink.so ${DESTDIR}${LIBDIR}
++      install .build/libuplink.a ${DESTDIR}${LIBDIR}
++      install -m 644 .build/uplink/* ${DESTDIR}${PREFIX}/include/uplink
++      install -m 644 .build/libuplink.pc ${DESTDIR}${LIBDIR}/pkgconfig
diff --git a/storj-uplink-c.spec b/storj-uplink-c.spec
new file mode 100644 (file)
index 0000000..833ef11
--- /dev/null
@@ -0,0 +1,92 @@
+#
+# Conditional build:
+%bcond_with    gpl2    # GPL v2 compatible package (drop Apache v2 licensed components)
+
+Summary:       C library for Storj V3 Network
+Summary(pl.UTF-8):     Biblioteka C do sieci Storj V3
+Name:          storj-uplink-c
+Version:       1.2.0
+Release:       1
+License:       MIT, other (used go components)
+Group:         Libraries
+#Source0Download: https://github.com/storj/uplink-c/releases
+Source0:       https://github.com/storj/uplink-c/archive/v%{version}/uplink-c-%{version}.tar.gz
+# Source0-md5: fd3b321db1b48839f58ca8da896f17b1
+Patch0:                %{name}-libdir.patch
+URL:           https://github.com/storj/uplink-c
+BuildRequires: golang >= 1.13
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+C library for Storj V3 Network.
+
+%description -l pl.UTF-8
+Biblioteka C do sieci Storj V3.
+
+%package devel
+Summary:       Header files for Storj uplink library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki Storj uplink
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description devel
+Header files for Storj uplink library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki Storj uplink.
+
+%package static
+Summary:       Static Storj uplink library
+Summary(pl.UTF-8):     Statyczna biblioteka Storj uplink
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static Storj uplink library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka Storj uplink.
+
+%prep
+%setup -q -n uplink-c-%{version}
+%patch0 -p1
+
+cat > scripts/version <<EOF
+#!/bin/sh
+echo %{version}
+EOF
+
+sed -i -e 's,^prefix=.*,prefix=%{_prefix},' \
+       -e 's,^libdir=.*,libdir=%{_libdir},' scripts/gen-pkg-config
+
+%build
+%{__make} build \
+       %{?with_gpl2:GPL2=true}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT \
+       PREFIX=%{_prefix} \
+       LIBDIR=%{_libdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%attr(755,root,root) %{_libdir}/libuplink.so
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/uplink
+%{_pkgconfigdir}/libuplink.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libuplink.a
This page took 0.111204 seconds and 4 git commands to generate.