Ticket #503: parrot_multidistro.patch
File parrot_multidistro.patch, 6.2 KB (added by wayland, 13 years ago) |
---|
-
parrot.spec
1 Name: parrot 2 Version: 1.0.0 3 Release: 1%{dist} 1 # Start out by figuring out distro 2 %define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0) 3 %define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0) 4 %define is_mandriva %(test -e /etc/mandriva-release && echo 1 || echo 0) 5 6 %define name parrot 7 %define version 1.0.0 8 9 %if %is_mandriva 10 %define release %mkrel 2 11 %define group Development/Perl 12 %define optimiseflags 13 %define libname %{mklibname} %{name} 14 %define libname_devel %{mklibname} -d %{name} 15 %define distro_buildreqs BuildRequires: perl-doc 16 %else 17 %define not_mandriva 1 18 %define release 1%{?dist} 19 %define group Development/Libraries 20 %define optimiseflags --optimize="$RPM_OPT_FLAGS -maccumulate-outgoing-args" 21 %define libname lib%{name} 22 %define libname_devel lib%{name}-devel 23 %define distro_buildreqs 0 24 %endif 25 26 %if %is_suse 27 %define _docdir %{_usr}/share/doc 28 %define curseslib ncurses 29 %else 30 %define curseslib curses 31 %endif 32 33 %if %{is_fedora} 34 %define distro_provides 1 35 %define distro_provides1 Provides: perl(Parrot::Pmc2c::PCCMETHOD_BITS) 36 %define distro_provides2 Provides: perl(Parrot::Pmc2c::MethodEmitter) 37 %define distro_provides3 Provides: perl(Parrot::Pmc2c::PMCEmitter) 38 %else 39 %define distro_provides 0 40 %endif 41 42 %define parrotlib %{_libdir}/parrot/%{version}-devel/ 43 44 Name: %{name} 45 Version: %{version} 46 Release: %{release} 4 47 Summary: Parrot Virtual Machine 5 48 License: Artistic 2.0 6 Group: Development/Libraries49 Group: %{group} 7 50 URL: http://www.parrot.org/ 8 Source0: ftp://ftp.parrot.org/pub/parrot/releases/stable/%{version}/ parrot-%{version}.tar.gz51 Source0: ftp://ftp.parrot.org/pub/parrot/releases/stable/%{version}/%{name}-%{version}.tar.gz 9 52 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 10 53 BuildRequires: readline-devel 11 54 BuildRequires: ncurses-devel … … 13 56 BuildRequires: gdbm-devel 14 57 BuildRequires: libicu-devel 15 58 BuildRequires: perl-Test-Harness 59 Requires: %{libname} = %{version}-%{release} 60 %if %{distro_buildreqs} 61 %{distro_buildreqs} 62 %endif 63 %if %{distro_provides} 64 %{distro_provides1} 65 %{distro_provides2} 66 %endif 16 67 17 %package docs 18 Summary: Parrot Virtual Machine documentation 19 License: Artistic 2.0 20 Group: Development/Libraries 21 BuildRequires: /usr/bin/perldoc 68 %description 69 Parrot is a virtual machine designed to efficiently compile and execute 70 bytecode for dynamic languages. Parrot is the target for Rakudo Perl 6, 71 as well as variety of other languages. 22 72 23 %package devel 24 Summary: Parrot Virtual Machine development headers and libraries 73 #-- 74 75 %package -n %{libname} 76 Summary: Parrot Virtual Machine run time library 25 77 License: Artistic 2.0 26 78 Group: Development/Libraries 79 Group: %{group} 80 Provides: lib%{name} = %{version}-%{release} 27 81 Requires: %{name} = %{version}-%{release} 28 82 Requires: %{_libdir}/pkgconfig 83 %if %{distro_provides} 84 %{distro_provides3} 85 %endif 29 86 30 %description 31 Parrot is a virtual machine designed to efficiently compile and execute 32 bytecode for dynamic languages. Parrot is the target for Rakudo Perl 6, 33 as well as variety of other languages. 87 %description -n %{libname} 88 Run time library for the Parrot Virtual Machine. 34 89 35 %description docs 90 %post -n %{libname} -p /sbin/ldconfig 91 92 %postun -n %{libname} -p /sbin/ldconfig 93 94 #-- 95 96 %if %{is_mandriva} 97 %define docsname doc 98 %else 99 %define docsname docs 100 %endif 101 102 %package %{docsname} 103 Summary: Parrot Virtual Machine documentation 104 License: Artistic 2.0 105 Group: %{group} 106 %if %{not_mandriva} 107 BuildRequires: /usr/bin/perldoc 108 %endif 109 110 %description %{docsname} 36 111 Documentation in text-, POD- and HTML-format (docs/html-subdirectory) and also 37 112 examples about the Parrot Virtual Machine 38 113 39 %description devel 114 #-- 115 116 %if %is_mandriva 117 %define develname -n %{name}_devel 118 %else 119 %define develname devel 120 %endif 121 122 %package %{develname} 123 Summary: Parrot Virtual Machine development headers and libraries 124 License: Artistic 2.0 125 Group: %{group} 126 Requires: %{libname} = %{version} 127 Requires: %{_libdir}/pkgconfig 128 129 %if is_mandriva 130 Provides: %{name}-devel = %version-%release 131 %else 132 %endif 133 134 %description %{develname} 40 135 Parrot Virtual Machine development headers and libraries. 41 136 42 137 %prep … … 48 143 tools/dev/install_files.pl 49 144 50 145 %build 51 if test "%{_vendor}" = "suse" 52 then 53 LIBS='-lncurses -lm' 54 else 55 LIBS='-lcurses -lm' 56 fi 146 %ifarch x86_64 147 RPM_OPT_FLAGS=`echo "$RPM_OPT_FLAGS" | %{__perl} -pi -e 's/-O2//'` 148 %endif 57 149 58 150 %ifarch i386 x86_64 59 151 %{__perl} Configure.pl \ … … 64 156 --mandir=%{_mandir} \ 65 157 --cc="%{__cc}" \ 66 158 --cxx=%{__cxx} \ 67 --optimize="$RPM_OPT_FLAGS -maccumulate-outgoing-args" \68 159 --parrot_is_shared \ 69 160 --lex=/usr/bin/flex \ 70 161 --yacc=/usr/bin/yacc \ 71 --libs=" $LIBS"162 --libs="-l%{curseslib} -lm" %{optimiseflags} 72 163 %else 73 164 # PowerPC 74 165 %{__perl} Configure.pl \ … … 116 207 %clean 117 208 rm -rf $RPM_BUILD_ROOT 118 209 119 %post -p /sbin/ldconfig120 121 %postun -p /sbin/ldconfig122 123 210 %files 124 211 %defattr(-,root,root,-) 125 212 %exclude %{_bindir}/parrot_config 126 213 %exclude %{_bindir}/parrot_debugger 127 214 %exclude %{_bindir}/pbc_* 128 215 %{_bindir}/* 216 217 %files -n %{libname} 218 %defattr(-,root,root,-) 219 %exclude %{parrotlib}/languages 129 220 %{_libdir}/parrot 130 %{_libdir}/ libparrot.so.*221 %{_libdir}/*.so.* 131 222 132 %files docs223 %files %{docsname} 133 224 %defattr(-,root,root,-) 134 225 %doc ChangeLog CREDITS NEWS PBC_COMPAT PLATFORMS README 135 226 %doc RESPONSIBLE_PARTIES TODO 136 227 %doc docs examples 137 228 138 %files devel229 %files %{develname} 139 230 %defattr(-,root,root,-) 140 231 %{_bindir}/parrot_config 141 232 %{_bindir}/parrot_debugger … … 150 241 %{_libdir}/pkgconfig/* 151 242 152 243 %changelog 244 * Thu Mar 26 2009 Tim Nelson <wayland@wayland.id.au> 1.0.0 245 - Modified to support multiple distributions better. Mandriva changes drawn from a .spec 246 file supplied by Jerome Quelin 247 153 248 * Tue Mar 17 2009 Allison Randal <allison@parrot.org> 1.0.0 154 249 - updated to 1.0.0 155 250