-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
libmpw.spec
85 lines (68 loc) · 1.78 KB
/
libmpw.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Name: libmpw
# >> macros
# << macros
Summary: MasterPassword library
Version: 2.6
Release: 5
Group: System/Libraries
License: GPLv3
URL: https://masterpassword.app/
Source0: mpw-2.6-cli-5-0-g344771db.tar.gz
Patch0: fix-build.patch
Requires: glibc >= 2.15
Requires: openssl-libs
Requires: json-c
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: glibc-devel >= 2.15
BuildRequires: openssl-devel
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(ncurses)
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(libsodium)
%description
The MasterPassword library
%package devel
Summary: MasterPassword headers
Requires: %{name} = %{version}-%{release}
%description devel
The MasterPassword headers
%prep
%setup -q -c
%patch0 -p1
# >> setup
# << setup
%build
# >> build pre
export CFLAGS="-fPIC -DMPW_SODIUM=1"
targets='mpw' ./build -lrt
# << build pre
# >> build post
gcc -std=gnu99 -Ilib/include -Icore -Icli -shared $CFLAGS -L. -o libmpw.so core/mpw-algorithm.c core/mpw-types.c core/mpw-util.c core/base64.c core/aes.c
# << build post
%install
rm -rf %{buildroot}
# >> install pre
# << install pre
mkdir -p %{buildroot}%{_libdir}
install -m755 libmpw.so %{buildroot}%{_libdir}/
ln -sf %{_libdir}/libmpw.so %{buildroot}%{_libdir}/libmpw.so.0
ln -sf %{_libdir}/libmpw.so %{buildroot}%{_libdir}/libmpw.so.0.0
mkdir -p %{buildroot}/usr/include/mpw
install -Dm644 core/mpw-{algorithm,types,util}.h %{buildroot}/usr/include/mpw
# >> install post
# << install post
%post -n libmpw -p /sbin/ldconfig
%postun -n libmpw -p /sbin/ldconfig
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/libmpw.so*
# >> files
# << files
%files devel
%defattr(-,root,root,-)
%{_includedir}/mpw/*.h
# >> files
# << files