%define rpmhome		%{_prefix}/lib/rpm
%define pubringdir	%{rpmhome}/gnupg
%define keyringdate	20130225

Summary:      The gnupg keyring for Vine Linux
Summary(ja):  Vine Linux 用の GnuPG 鍵輪
Name:         vine-keyring
Version:      2.12
Release:      1%{?_dist_release}
License:      distributable without modification
Group:        System Environment/Libraries
Source0:      %{name}-%{keyringdate}.tar.xz
Source10:     gpg-import.sh
Source11:     gpg-import.lua
Source12:     gpg-import.conf
BuildArchitectures: noarch

Vendor: Project Vine
Distribution: Vine Linux
Packager: daisuke

BuildRoot:    %{_tmppath}/%{name}-%{version}-root
Requires:     gnupg
PreReq:       sh-utils, gnupg, fileutils
Autoreqprov:  off

%description
This package contains the gnup keyring that is used to sign
Vine Linux rpm packages by Vine Linux official developpers.
It will be installed in %{rpmhome}/gnupg/pubring.gpg.

This gpg keyring should include following developpers.
- Project Vine
- VineSeed/VineSeedPlus developpers
- VinePlus developpers
- Security Watch Team
- Documentation Team
..

%description -l ja
このパッケージには、Vine Linux のオフィシャルの開発者が rpm パッケージ
に署名するために使用している GnuPG の公開鍵が鍵輪として、以下の場所に
インストールされています。(%{rpmhome}/gnupg/pubring.gpg)

Vine Linux の開発者の公開鍵はかならずこの鍵輪に含まれている必要があり
ます。

%prep
%setup -n %{name}

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{pubringdir}
install %{name}.gpg* $RPM_BUILD_ROOT%{pubringdir}
touch $RPM_BUILD_ROOT%{pubringdir}/pubring.gpg

# install gpg-import.lua staff
mkdir -p $RPM_BUILD_ROOT%{rpmhome}
install -m744 %{SOURCE10} $RPM_BUILD_ROOT%{rpmhome}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/apt/scripts/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/apt/apt.conf.d/
install %{SOURCE11} $RPM_BUILD_ROOT%{_datadir}/apt/scripts/
install %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/apt/apt.conf.d/

%post
if [ ! -f %{pubringdir}/pubring.gpg ]; then
    touch %{pubringdir}/pubring.gpg
fi
gpg -q --batch --no-options --homedir %{pubringdir} < /dev/null > /dev/null 2>&1 ||:
gpg -q --batch --no-options --no-default-keyring --no-permission-warning \
       --secret-keyring /dev/null --homedir %{pubringdir} \
       --keyring %{pubringdir}/vine-keyring.gpg --export -a | \
gpg -q --batch --no-options --no-default-keyring --no-permission-warning \
       --secret-keyring /dev/null --homedir %{pubringdir} \
       --keyring %{pubringdir}/pubring.gpg --import ||:
touch %{pubringdir}/.need_to_import
exit 0


%files
%defattr(644,root,root)
%attr(755,root,root) %dir %{pubringdir}
%ghost %{pubringdir}/pubring.gpg
%config %{pubringdir}/vine-keyring.gpg
%config %{pubringdir}/vine-keyring.gpg.sha1sum.gpg
%attr(744,root,root) %{rpmhome}/gpg-import.sh
%attr(755,root,root) %{_datadir}/apt/scripts/*
%{_sysconfdir}/apt/apt.conf.d/*


%changelog
* Mon Feb 25 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.12-1
- update vine-keyring
  - add tomop (new key)

* Fri Jul 22 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.11-1
- refresh all keys from keyserver

* Tue Mar 08 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.10-1
- update vine-keyring
  - add yasumichi (new key)
- refresh all keys from keyserver

* Wed Dec 08 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
- update vine-keyring
  - add Jiro Matsuzawa
  - add iwaim (new key)
- refresh all keys from keyserver

* Thu Sep 09 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8-1
- update vine-keyring
  - add daisuke (new key)
  - add shaolin (new key)
  - add yasumichi (new key)
  - add munepi (new key)
- refresh all keys from keyserver

* Wed Feb 10 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-2
- fix build on x86_64

* Wed Feb 10 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
- add new uid

* Sun Nov 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6-1
- update vine-keyring
  - replace takemikaduchi key by new key...

* Sun Nov 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.5-1
- update vine-keyring
  - add Takemikaduchi

* Wed Sep 23 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4-1
- update vine-keyring
  - new key for Toshiaki Ara
  - refresh keys from keyserver

* Sun Sep 20 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.3-1
- update vine-keyring
  - add new sigs, refresh keys from keyserver
  - add Toshiaki Ara

* Wed Jul 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2-1
- update vine-keyring
  - add new uid, sigs
  - refresh keys from keyserver

* Mon Dec 08 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1-1
- update vine-keyring
  - add Toshiharu Kudoh, tomcat

* Sun Aug 17 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-1
- new versioning policy, spec in utf8

* Mon Mar 17 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl19
- update vine-keyring
  - add Munehiro Yamamoto, TOSHI

* Thu Jan 24 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl18
- update vine-keyring
  - add Kunio Murasawa, yamamoto, Masahiro INOUE

* Sat Aug 11 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl17
- update vine-keyring

* Sat Jan 20 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl16
- update vine-keyring
  - add Hideki MIWA, Susumu Tanimura

* Sat Nov 18 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl15
- update vine-keyring
  - add Takuya Kobayashi

* Mon Sep 18 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl14
- update gpg-import.sh
  - set "HOME=/root" on exec gpg.

* Wed Sep 13 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.0-0vl13
- change Group to System Environment/Libraries. <BTS:VineLinux:163>

* Tue Jun 06 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl12
- update vine-keyring
  - add kazutaka harada

* Tue May 23 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl11
- update vine-keyring
  - add Takahiro Adachi

* Sat May 20 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl10
- update vine-keyring
  - add NAKAMURA Kenta's new key, revoke old one.

* Tue May 16 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl9
- move gpg-import.lua to %%{_datadir}/apt/scripts

* Tue May 16 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl8
- update vine-keyring
  - add Shoji Matsumoto

* Wed Dec 21 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl7
- update vine-keyring
  - add KATO Masashi

* Tue Dec 20 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl6
- add gpg-import.{lua,conf,sh} to import gpg pubkeys
  in apt's post rpm transaction.
- add flag to check new gpg keys

* Tue Dec 20 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl5
- disable gpg pubkey import (it may cause rpmdb coprruption..)

* Sun Dec 18 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl4
- make /usr/lib/rpm/gnupg/pubring.gpg for apt.

* Sun Dec 18 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl3
- update %%post scripts

* Sun Dec 18 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl2
- add add gpg public keys as %%pubkey in %%files
- update vine-keyring
  - add KITA Toshihiro (see keyring fo details)

* Fri Dec 16 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl1
- modified keyring import mechanism to support rpm-4.4

* Mon Oct 31 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl20
- update vine-keyring
  - add Atsushi SHICHI, NAKAMURA Kenta (see keyring for details)

* Thu Aug 25 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl19
- update vine-keyring
  - add Seiya Nishizawa (see keyring for details)

* Mon Apr 04 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl18
- update vine-keyring
  - add Shu KONNO (see keyring for details)

* Thu Feb 24 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl17
- update vine-keyring
  - add Yasumichi Akahoshi, TANAKA hiroaki (see keyring for details)

* Sun Nov 28 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl16
- update vine-keyring
  - add Satoshi IWAMOTO (see keyring for details)

* Tue Oct 05 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl15
- update vine-keyring
  - add Takeyuki Fujioka (see keyring for details)

* Fri Sep 24 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl14
- update vine-keyring
  - add USAMI kosuke (see keyring for details)

* Sat Aug 21 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl13
- update vine-keyring
  - add UECHI Yasumasa, KANEKO Seiji (see keyring for details)

* Tue Aug 17 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl12
- update vine-keyring
  - add IKEDA Katsumi, HOTTA Michihide (see keyring for detail)

* Thu Aug 05 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl11
- update vine-keyring
  - add Ryoichi INAGAKI (see keyring for detail)

* Fri Jun 18 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl10
- update vine-keyring
  - add Hiroaki Irokawa (see keyring for detail)

* Mon Apr 19 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl9
- update vine-keyring
  - add NISHIMURA Daisuke (see keyring for detail)

* Sat Apr 17 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl8
- update vine-keyring
  - add AKIYAMA Kazuhito (see keyring for detail)

* Fri Apr 16 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl7
- update vine-keyring
  - add KAZUKI SHIMURA (see keyring for detail)

* Wed Apr 14 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl6
- update vine-keyring
  - add Tomoya Taka (see keyring for detail)

* Sun Apr 11 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl5
- update vine-keyring
  - add tkoba, iwai, tomop (see keyring for details)

* Fri Apr 09 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl4
- add "--homedir %%{pubringdir}" to gpg option in %%post script.

* Thu Apr 08 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl3
- add "--secret-keyring /dev/null" to gpg option in %%post script.

* Wed Apr 07 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl2
- update vine-keyring, add signed md5sum file.

* Wed Apr 07 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl1
- initial build for Vine Linux, partly based on SUSE's suse-build-key package.
