LogoSailfishOS Open Build Service > Projects
Log In

View File libmpw.spec of Package libmpw (Project home:ilpianista)

Name:       libmpw

# >> macros
# << macros

Summary:    MasterPassword library
Version:    2.6
Release:    2
Group:      System/Libraries
License:    GPL3
URL:        https://masterpassword.app/
Source0:    mpw-2.6-cli-5-0-g344771db.tar.gz
Requires:   glibc >= 2.15
Requires:   openssl
Requires:   json-c
Requires:   libsodium
BuildRequires:  glibc-devel >= 2.15
BuildRequires:  openssl
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(ncurses)
BuildRequires:  pkgconfig(json-c)
BuildRequires:  pkgconfig(libsodium)

%description
The MasterPassword library

%package devel
Summary: MasterPassword headers

%description devel
The MasterPassword headers

%prep
%setup -q -c

# >> 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 -Dm644 libmpw.so %{buildroot}%{_libdir}
ln -sf %{_libdir}/libmpw.so %{buildroot}%{_libdir}/libmpw.so.0

mkdir -p %{buildroot}/usr/include/mpw
install -Dm644 core/mpw-{algorithm,types,util}.h %{buildroot}/usr/include/mpw
# >> install post
# << install post

%files
%defattr(-,root,root,-)
%{_libdir}/libmpw.so*
# >> files
# << files

%files devel
%defattr(-,root,root,-)
%{_includedir}/mpw/*.h
# >> files
# << files