1 |
%define _disable_ld_no_undefined 1 |
2 |
|
3 |
# The version flow of zsh: N - N-dev-1 - ... - (N+1)-pre-1 ... (N+1) |
4 |
#define dev 0 |
5 |
#define pre 0 |
6 |
%define zshversion 4.3.11 |
7 |
|
8 |
%if %{?dev:1}%{!?dev:0} && %{?pre:1}%{!?pre:0} |
9 |
%{error:Both %%pre and %%dev defined} |
10 |
%endif |
11 |
|
12 |
%if %{?dev:1}%{!?dev:0} || %{?pre:1}%{!?pre:0} |
13 |
%define devdir development/ |
14 |
%endif |
15 |
|
16 |
%define srcversion %{zshversion}%{?pre:-pre-%{pre}}%{?dev:-dev-%{dev}} |
17 |
|
18 |
Summary: A shell with lots of features |
19 |
Name: zsh |
20 |
Version: %zshversion%{?dev:.dev%{dev}} |
21 |
Release: %mkrel %{?pre:0.pre%{pre}.}1 |
22 |
Url: http://www.zsh.org |
23 |
License: BSD-like |
24 |
Group: Shells |
25 |
Source0: http://www.zsh.org/pub/%{?devdir}%name-%{srcversion}.tar.bz2 |
26 |
Source1: http://www.zsh.org/pub/%{?devdir}%name-%{srcversion}-doc.tar.bz2 |
27 |
Source2: zcfg-mga.tar.bz2 |
28 |
Source3: http://zsh.dotsrc.org/Guide/zshguide.tar.gz |
29 |
Source4: zsh.urpmi_comp |
30 |
|
31 |
# Upstream patches (none at the moment) |
32 |
|
33 |
Requires(postun): rpm-helper |
34 |
Requires(post): rpm-helper |
35 |
Epoch: 1 |
36 |
BuildRequires: ncurses-devel libtermcap-devel >= 2.0, texinfo yodl pcre-devel |
37 |
BuildRequires: rpm-helper >= 0.18.5 |
38 |
BuildRequires: gdbm-devel |
39 |
BuildRequires: groff |
40 |
|
41 |
BuildRoot: %_tmppath/%name-buildroot |
42 |
|
43 |
%description |
44 |
Zsh is a UNIX command interpreter (shell) usable as an |
45 |
interactive login shell and as a shell script command |
46 |
processor. Of the standard shells, zsh most closely resembles |
47 |
ksh but includes many enhancements. Zsh has command-line editing, |
48 |
built-in spelling correction, programmable command completion, |
49 |
shell functions (with autoloading), a history mechanism, and a |
50 |
lots of other features |
51 |
|
52 |
Install the zsh package if you'd like to try out a different shell. |
53 |
|
54 |
%package doc |
55 |
Summary: The doc package of zsh |
56 |
Group: Books/Computer books |
57 |
|
58 |
%description doc |
59 |
Zsh is a UNIX command interpreter (shell) usable as an |
60 |
interactive login shell and as a shell script command |
61 |
processor. Of the standard shells, zsh most closely resembles |
62 |
ksh but includes many enhancements. Zsh has command-line editing, |
63 |
built-in spelling correction, programmable command completion, |
64 |
shell functions (with autoloading), a history mechanism, and a |
65 |
lots of other features |
66 |
|
67 |
This package include doc guid examples and manual for zsh. |
68 |
|
69 |
%prep |
70 |
%setup -q -a 2 -a 1 -n %name-%srcversion |
71 |
|
72 |
mv %name-%{srcversion}/Doc/* Doc/ |
73 |
|
74 |
mv -f Completion/Mandriva Completion/%_vendor |
75 |
install -m 0644 %{SOURCE4} Completion/%_vendor/Command/_urpmi |
76 |
|
77 |
# remove temporary files |
78 |
find | grep '~$' | xargs rm -f |
79 |
perl -pi -e 's|/usr/local/bin/|%_bindir/|' Functions/Misc/{run-help,checkmail,zcalc} |
80 |
|
81 |
%build |
82 |
|
83 |
# check for tcsetpgrp fails with "configure: error: no controlling tty" when |
84 |
# building by bot; force tcsetpgrp |
85 |
%configure2_5x \ |
86 |
--enable-etcdir=%_sysconfdir \ |
87 |
--enable-function-subdirs \ |
88 |
%ifarch sparc |
89 |
--disable-lfs \ |
90 |
%endif |
91 |
--enable-pcre \ |
92 |
--with-tcsetpgrp |
93 |
make all |
94 |
|
95 |
%install |
96 |
rm -rf $RPM_BUILD_ROOT |
97 |
|
98 |
make install DESTDIR=%buildroot |
99 |
make install.info DESTDIR=%buildroot |
100 |
|
101 |
# copy Mageia Configuration files. |
102 |
mkdir -p $RPM_BUILD_ROOT/{bin,etc} |
103 |
cp -a zcfg/etc/z* $RPM_BUILD_ROOT%_sysconfdir |
104 |
cp -a zcfg/share/zshrc_default %buildroot%_datadir/zsh/%srcversion/zshrc_default |
105 |
|
106 |
# this prevents RPM helper from adding dependency on /usr/bin/zsh |
107 |
find %buildroot%_datadir/zsh/%srcversion -type f -exec chmod 0644 '{}' \; |
108 |
|
109 |
# Backward compatibilie should be removed in the others times. |
110 |
pushd $RPM_BUILD_ROOT/bin && { |
111 |
mv ..%_bindir/zsh ./zsh |
112 |
} && popd |
113 |
|
114 |
# zshall.1 includes all other man pages which does not work with compressed |
115 |
# files. Generate full contents here |
116 |
pushd $RPM_BUILD_ROOT%_mandir && { |
117 |
/usr/bin/soelim man1/zshall.1 > zshall-full |
118 |
mv zshall-full man1/zshall.1 |
119 |
popd |
120 |
} |
121 |
|
122 |
rm -f $RPM_BUILD_ROOT%_bindir/zsh-%srcversion |
123 |
|
124 |
# Copy documentation. |
125 |
rm -rf docroot |
126 |
mkdir -p docroot/{Info_html,Examples,Documentation}/ |
127 |
|
128 |
cp -a README docroot/ |
129 |
cp -a Functions/Misc/* Misc/* Util/* docroot/Examples/ |
130 |
cp -a INSTALL ChangeLog* docroot/Documentation |
131 |
cp -a StartupFiles docroot/ |
132 |
cp -a Etc/* docroot/Documentation |
133 |
cp -a Doc/*html docroot/Info_html/ |
134 |
|
135 |
mkdir -p docroot/Zsh_Guide |
136 |
tar xzf %SOURCE3 -C docroot/Zsh_Guide |
137 |
( cd docroot/Zsh_Guide/zshguide/ ; make ) |
138 |
mv docroot/Zsh_Guide/zshguide/*html docroot/Zsh_Guide/ |
139 |
rm -Rf docroot/Zsh_Guide/zshguide/ |
140 |
|
141 |
# Doc |
142 |
rm -f docroot/{StartupFiles/.distfiles,Examples/{Makefile*,*.yo},Documentation/{Makefile*,*.yo}} |
143 |
find docroot/ -name 'Makefile*' -o -name '.yo'|xargs rm -f |
144 |
find docroot/ -type f|xargs perl -pi -e 's@^#!%_prefix/local/bin/(perl|zsh)@#!%_bindir/\1@' |
145 |
mv docroot/Examples/compctl-examples docroot/StartupFiles |
146 |
|
147 |
%clean |
148 |
rm -rf $RPM_BUILD_ROOT |
149 |
|
150 |
%post |
151 |
%_post_shelladd /bin/zsh |
152 |
%_install_info %name.info |
153 |
|
154 |
%preun |
155 |
%_remove_install_info %name.info |
156 |
%_preun_shelldel /bin/zsh |
157 |
|
158 |
%files |
159 |
%defattr(-,root,root,0755) |
160 |
%doc docroot/README NEWS |
161 |
%config(noreplace) %_sysconfdir/z* |
162 |
/bin/%name |
163 |
%_mandir/man1/*.1* |
164 |
%_infodir/*.info* |
165 |
%dir %_datadir/zsh |
166 |
%dir %_datadir/zsh/%{srcversion}/ |
167 |
%_datadir/zsh/%{srcversion}/functions |
168 |
%_datadir/zsh/%{srcversion}/scripts |
169 |
%_datadir/zsh/%{srcversion}/zshrc_default |
170 |
%dir %_libdir/zsh |
171 |
%_libdir/zsh/%{srcversion}/ |
172 |
%_datadir/zsh/site-functions/ |
173 |
|
174 |
%files doc |
175 |
%defattr(-,root,root) |
176 |
%doc docroot/Documentation/ docroot/Examples/ docroot/Info_html/ |
177 |
%doc docroot/StartupFiles/ docroot/Zsh_Guide ChangeLog* LICENCE |
178 |
|
179 |
|