Blob Blame History Raw
## $Id: xca.spec,v 1.21 2008/01/05 23:33:28 alexlan Exp $

%{!?release_func:%global release_func() %1%{?dist}}

Summary:	Graphical X.509 certificate management tool
Name:		xca
Version:	0.6.4
Release:	%release_func 3

License:	BSD
Group:		Applications/Productivity
URL:		http://www.hohnstaedt.de/xca.html
Source0:	http://download.sourceforge.net/sourceforge/xca/%name-%version.tar.gz
Source1:	README.update
Source4:	xca.xml
Patch0:		xca-0.6.3-locale.patch
Patch1:         xca-0.6.4-newopenssl.patch
BuildRoot:	%_tmppath/%name-%version-%release-buildroot
BuildRequires:	qt4-devel openssl-devel
BuildRequires:	db4-devel
BuildRequires:	xdg-utils
BuildRequires:	ImageMagick
BuildRequires:	linuxdoc-tools
Requires:		hicolor-icon-theme
Requires(posttrans):	shared-mime-info
Requires(postun):	shared-mime-info

# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246324
ExcludeArch:		ppc64

%description
The Program uses a Berkeley db for storage and supports RSA keys.
Certificate signing requests (PKCS#10) and Certificates (X509v3), the
signing of requests, and the creation of selfsigned certificates is
supported. Both can use templates for simplicity.  The PKI structures
can be imported and exported in several formats like PKCS#7, PKCS#12,
PEM, DER, PKCS#8.


%prep
%setup -q
%patch0 -p1 -b .locale
%patch1 -p1 -b .newopenssl

mkdir -p _tmp_root/usr 	 
ln -s /usr/%_lib	_tmp_root/usr/lib 	 
ln -s /%_lib		_tmp_root/lib
ln -s %_includedir/Qt	_tmp_root/include

install -p -m644 %SOURCE1 '.'

sed -i -e 's!xca\.xpm!fedora-xca!g;s!^Exec=.*!\0 %f!' misc/xca.desktop


%build
#test -n "$QTDIR" || . %_sysconfdir/profile.d/qt.sh
export QTDIR=%_libdir/qt4
CC='%__cc' LD='%__ld' CFLAGS="$RPM_OPT_FLAGS -DXCA_DEFAULT_TRANSLATE=\\\"%_datadir/qt4/translations\\\"" STRIP=: prefix=%_prefix \
./configure `pwd`/_tmp_root{,/usr}
make %{?_smp_mflags}

convert img/xca.ico xca.png
convert img/xdb.ico xdb.png


%install
rm -rf "$RPM_BUILD_ROOT"

make destdir="$RPM_BUILD_ROOT" mandir=share/man install
make destdir="$RPM_BUILD_ROOT" mandir=share/man install -C misc TOPDIR=..

# HACK: check whether workarounds below are still necessary
test ! -e $RPM_BUILD_ROOT%_datadir/xca/crl.png

install -d -m755           $RPM_BUILD_ROOT%_datadir/{applications,mime/packages,icons/hicolor}
install -p -m644 img/*.png $RPM_BUILD_ROOT%_datadir/xca
install -p -m644 %SOURCE4  $RPM_BUILD_ROOT%_datadir/mime/packages/

export XDG_DATA_DIRS=$RPM_BUILD_ROOT%_datadir
export XDG_UTILS_INSTALL_MODE=system

xdg-icon-resource install --noupdate --context mimetypes --size 32 xdb.png application-x-xca-database
xdg-icon-resource install --noupdate                     --size 32 xca.png fedora-xca

desktop-file-install --vendor fedora --mode 0644		\
  --dir $RPM_BUILD_ROOT%_datadir/applications			\
  --delete-original						\
  --add-mime-type application/x-xca-database			\
  --remove-category QT						\
  $RPM_BUILD_ROOT%_datadir/applications/xca.desktop


%clean
rm -rf "$RPM_BUILD_ROOT"


%post
touch --no-create %_datadir/icons/hicolor || :

%preun
touch --no-create %_datadir/icons/hicolor || :

%posttrans
gtk-update-icon-cache %_datadir/icons/hicolor &>/dev/null || :
update-mime-database  %_datadir/mime          &>/dev/null || :
update-desktop-database                       &>/dev/null || :

%postun
update-desktop-database                       &>/dev/null || :
update-mime-database  %_datadir/mime          &>/dev/null || :
gtk-update-icon-cache %_datadir/icons/hicolor &>/dev/null || :


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYRIGHT README.update
%_bindir/*
%attr(0644,root,root) %_mandir/*/*
%dir %{_datadir}/xca
%_datadir/xca/*.png
%_datadir/xca/*.txt
%_datadir/xca/*.html
%_datadir/xca/*.xca
%_datadir/icons/*/*/*/*.png
%_datadir/mime/packages/%name.*
%lang(de) %_datadir/xca/xca_de.qm
%lang(es) %_datadir/xca/xca_es.qm

%_datadir/applications/*


%changelog
* Sat Jan  5 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.6.4-3
- Add patch by Caolan McNamara (#427619) to build against new openssl

* Sat Aug 25 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.4-1
- updated to 0.6.4
- optimized scriptlets which are dealing with the desktop stuff

* Sat Jun 30 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.3-2
- improved desktop-integration by registering MIME type and icons
- disabled ppc64 build (bz #246324)

* Thu Jun 14 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.3-1
- updated to 0.6.3; rediffed patches
- fixed build
- added BR on linuxdoc-tools

* Mon Apr  9 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.1-1
- updated to 0.6.1

* Sat Mar 17 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.6.0-1
- updated to 0.6.0
- removed old patches

* Fri Sep 15 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.1-6
- rebuilt

* Sat Feb 18 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.1-5
- rebuilt for FC5

* Sun Dec 25 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.1-4
- fixed compilation with gcc41 and openssl098
- use SHA1 instead of MD5 as the default hashalgo

* Sat May 21 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.1-3
- generalized db4 detection
- fixed x86_64 builds

* Thu May 19 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.1-2
- use %%dist instead of %%disttag

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Tue Mar  8 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.5.1
- updated to 0.5.1
- (re)enabled parallel build
- applied -langinst patch and other ideas from
  https://bugzilla.fedora.us/show_bug.cgi?id=2019 (Ville Skyttä)
- fixed build with gcc4 and db43
- removed old cruft from the specfile

* Sat Dec 13 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.4.6-0.fdr.1
- changed compile/install commands to work with the new, yet-another configure system
- removed libpthread test since it went upstream
- do not package README anymore; it contains installation/build instructions only
- applied gcc3 patch
- updated to 0.4.6
- removed desktop patch which went upstream

* Fri Aug 15 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.5-0.fdr.2
- applied Ville Skyttä's patch to add categories and to fix encoding of desktop-file
  (http://sourceforge.net/tracker/index.php?func=detail&aid=789374&group_id=62274&atid=500027)
- removed '--add-category ...' options which become obsoleted by this
  patch

* Fri Aug 15 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.5-0.fdr.1
- updated to 0.4.5

* Thu Aug  7 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.4-0.fdr.1
- updated to 0.4.4
- use generic download address for Source0

* Sat Jul 26 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.2-0.fdr.1.1
- changed Summary: accordingly the suggestion in Fedora bug #494

* Mon Jul 21 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.2-0.fdr.1
- updated to 0.4.2

* Sun Jul 20 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.1-0.fdr.2
- removed the %%{smp_mflags} since parallel builds are not supported
  by the QT makefiles

* Tue Jul 15 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.1-0.fdr.1
- updated to 0.4.1
- added debian/changelog to %%doc-list

* Tue Jul  8 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.4.0-0.fdr.1
- updated to 0.4.0
- removed patches which went upstream

* Fri Jul  4 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.3.2-0.fdr.2.1
- fixed Summary

* Tue Jul  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0:0.3.2-0.fdr.2
- added icon
- made minor fixes in the %%description
- added explicit epoch
- created a separate .desktop file

* Tue Jun 10 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.3.2-0.fdr.1
- prepared for fedora.us

* Tue Jun 10 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 0.3.2-0.0.3
- added dbpriv patch
- added desktop entry

* Fri Jun  6 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
- Initial build.