123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- ############################################################
- # directory <baseuri>/<distribution_name>/RPMS.<component>
- # default /var/local/apt-repository/vine-nosrc/RPMS.self-build
- %define baseuri /var/local/apt-repository
- %define distribution_name vine-nosrc
- %define component self-build
- # scheme [file,copy]
- # default file
- %define scheme file
- # vendor_id
- # default { }
- ### example {[your_id]}
- %define vendor_id { }
- # genbasedir command option
- # default {--flat}
- ### example {--flat --progress -s --default-key=KEYID}
- %define genbasedir_option {--flat}
- ### DEFAULT : NO VEDOR_ID , NO SIGNATURE
- ### TO SIGN AUTOMATICALLY, YOU SHOULD REWRITE CRON FILE.
- # cron schedule [hourly,daily,weekly,monthly]
- %define schedule weekly
- # niceness (genbasedir command in cron file)
- # -20(highest) 0(normal) 19(lowest)
- # default 1
- %define niceness 1
- ############################################################
- %define pkg_version 1
- %define pkg_release 1%{?_dist_release}
- Summary: local apt repository setup (%{distribution_name}:%{component})
- Summary(ja): ローカルのAPTリポジトリを扱うためのパッケージ (%{distribution_name}:%{component})
- Name: local-apt-repository-%{distribution_name}-%{component}
- Version: %{pkg_version}
- Release: %{pkg_release}
- License: GPL
- Group: Applications/Administration
- BuildRoot: %{_tmppath}/%{name}-%{version}-root
- BuildArch: noarch
- Requires: apt crontabs
- Packager: Takuya Kobayashi <ruby11@cocoa.ocn.ne.jp>
- Vendor: Project Vine
- Distribution: Vine Linux
- %description
- This package makes local apt repository.
- scheme - %{scheme}
- baseuri - %{baseuri}
- distribution - %{distribution_name}
- component - %{component}
- resource list - %{_sysconfdir}/apt/sources.list.d/%{distribution_name}-%{component}.list
- update script - %{baseuri}/%{distribution_name}/update-%{distribution_name}-%{component}.sh
- cron file - %{_sysconfdir}/cron.%{schedule}/update-%{distribution_name}-%{component}.cron
- %description -l ja
- ローカルのAPTリポジトリを作成、管理するためのパッケージです。
- このパッケージは
- scheme - %{scheme}
- baseuri - %{baseuri}
- distribution - %{distribution_name}
- component - %{component}
- resource list - %{_sysconfdir}/apt/sources.list.d/%{distribution_name}-%{component}.list
- update script - %{baseuri}/%{distribution_name}/update-%{distribution_name}-%{component}.sh
- cron file - %{_sysconfdir}/cron.%{schedule}/update-%{distribution_name}-%{component}.cron
- として build されています。
- %{baseuri}/%{distribution_name}/RPMS.%{component}
- %{baseuri}/%{distribution_name}/SRPMS.%{component}
- にパッケージを入れて
- update script (%{baseuri}/%{distribution_name}/update-%{distribution_name}-%{component}.sh)
- を実行するとリポジトリの作成は完了し、
- %{_bindir}/apt-get update を実行すると利用できるようになります。
- パッケージの追加や削除の際は、update script や cron file でリポジトリの情報を更新してください。
- apt_preferences, genbasedir, sources.list, vendors.list 等の man page を参照し、
- 必要に応じて %{baseuri}/%{distribution_name}/base/ 以下のファイルを書き換えてください。
- baseuri 等を変更する場合は、Source RPM を入手し spec ファイルを書き換えてください。
- %prep
- if [ -e %{buildroot} ] ; then
- [ "%{buildroot}" != "/" ] && %{__rm} -r %{buildroot}
- fi
- %build
- %{__mkdir_p} %{name}-%{version}
- # write sources.list
- %{__cat} << EOF > %{name}-%{version}/%{distribution_name}-%{component}.list
- rpm %{vendor_id} %{scheme}:%{baseuri} %{distribution_name} %{component}
- rpm-src %{vendor_id} %{scheme}:%{baseuri} %{distribution_name} %{component}
- EOF
- #%{__cat} %{name}-%{version}/%{distribution_name}-%{component}.list
- # write update script
- %{__cat} << EOF > %{name}-%{version}/update-%{distribution_name}-%{component}.sh
- #! /bin/bash
- %{_bindir}/genbasedir %{genbasedir_option} %{baseuri}/%{distribution_name}
- EOF
- #%{__cat} %{name}-%{version}/update-%{distribution_name}-%{component}.sh
- # write cron file
- %{__cat} << EOF > %{name}-%{version}/update-%{distribution_name}-%{component}.cron
- #! /bin/bash
- %{_sysbindir}/nice -n %{niceness} %{_bindir}/genbasedir %{genbasedir_option} %{baseuri}/%{distribution_name}
- EOF
- #%{__cat} %{name}-%{version}/update-%{distribution_name}-%{component}.cron
- %install
- # make component directories
- %{__mkdir_p} %{buildroot}/%{baseuri}/%{distribution_name}/RPMS.%{component}
- %{__mkdir_p} %{buildroot}/%{baseuri}/%{distribution_name}/SRPMS.%{component}
- # install sources.list
- %{__mkdir_p} %{buildroot}/%{_sysconfdir}/apt/sources.list.d
- %{__install} -m 644 %{name}-%{version}/%{distribution_name}-%{component}.list %{buildroot}/%{_sysconfdir}/apt/sources.list.d
- # install update script
- %{__install} -m 744 %{name}-%{version}/update-%{distribution_name}-%{component}.sh %{buildroot}/%{baseuri}/%{distribution_name}/
- # install cron file
- %{__mkdir_p} %{buildroot}/%{_sysconfdir}/cron.%{schedule}
- %{__install} -m 744 %{name}-%{version}/update-%{distribution_name}-%{component}.cron %{buildroot}/%{_sysconfdir}/cron.%{schedule}
- %files
- %defattr (-,root,root)
- %dir %{baseuri}/%{distribution_name}/RPMS.%{component}
- %dir %{baseuri}/%{distribution_name}/SRPMS.%{component}
- %{baseuri}/%{distribution_name}/update-%{distribution_name}-%{component}.sh
- %config %{_sysconfdir}/cron.%{schedule}/update-%{distribution_name}-%{component}.cron
- %config %{_sysconfdir}/apt/sources.list.d/%{distribution_name}-%{component}.list
- %clean
- [ "%{buildroot}" != "/" ] && %{__rm} -r %{buildroot}
- %changelog
- * Fri Oct 03 2008 Shu KONNO <owa@bg.wakwak.com> 1-1vl5
- - applied new versioning policy, spec in utf-8
- * Tue Oct 16 2007 Takuya Kobayashi <ruby11@cocoa.ocn.ne.jp> 1-0vl1
- - Initial Package for Vine Linux
|