#
# Adapter adapts .spec files for PLD Linux.
#
-# Copyright (C) 1999-2013 PLD-Team <feedback@pld-linux.org>
+# Copyright (C) 1999-2014 PLD-Team <feedback@pld-linux.org>
# Authors:
# MichaĆ Kuratczyk <kura@pld.org.pl>
# Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
}
/^%define/ {
- # Remove defining _applnkdir (this macro has been included in rpm-3.0.4)
- if ($2 == "_applnkdir") {
- next
- }
-
# FIXME: this section will likely never match after cvs->git migration
if ($2 == "date") {
if (did_files == 0) {
# %package part
/^%package/, (!/^%package/ && $0 ~ SECTIONS) {
+ # FIXME: this breaks \t indenting in preamble?
gsub(/\t/, " ")
}
if ($1 ~ /chmod/ && $2 ~ /644/)
next
- # atrpms
$0 = fixedsub("%perl_makeinstall", "%{__make} pure_install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0)
-
- # alt linux
$0 = fixedsub("%make_install DESTDIR=$RPM_BUILD_ROOT install", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0)
+ $0 = fixedsub("%make_install", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0)
}
##########
$1 = "Requires:"
}
+ # deprecated. such deps are autogenerated in rpm5
+ if ($0 == "%{?ruby_mod_ver_requires_eq}") {
+ next
+ }
+
# F<16 had requires(hint)
if (/^Requires\(hint\):/) {
$1 = "Suggests:"
$0 = format_requires($1, value)
}
- # BR: tar (and others) is to common (rpm-build requires it)
+ # BR: tar (and others) are too common (rpm-build requires it)
if (field == "buildrequires:") {
l = substr($0, index($0, $2))
if (l == "awk" ||
$1 = "License:"
}
+ if (field == "buildarch:") {
+ $1 = "BuildArch:"
+ }
+
+
# ease updating from debian .dsc
if (field ~ /homepage:/) {
$1 = "URL:"
if (l == "Apache License 2.0" || \
l == "Apache 2.0" || \
l == "Apache 2" || \
+ l == "Apache-2.0" || \
l == "Apache License (2.0)" ||
l == "Apache License Version 2.0" || \
l == "Apache License, Version 2.0" || \
if ($1 == "R:" ) {
$1 = "Requires:"
}
+ common_macros()
format_preamble()
# kill_preamble_macros(); # breaks tabbing
}
}
+# replace common macros
+function common_macros() {
+ gsub(/%name/, "%{name}")
+ gsub(/%version/, "%{version}")
+ gsub(/%release/, "%{release}")
+ gsub(/%epoch/, "%{epoch}")
+ gsub(/%_sysconfdir/, "%{_sysconfdir}")
+ gsub(/%_unitdir/, "%{systemdunitdir}")
+ gsub(/%_initdir/, "/etc/rc.d/init.d")
+ gsub(/%_man1dir/, "%{_mandir}/man1")
+ gsub(/%_man2dir/, "%{_mandir}/man2")
+ gsub(/%_man3dir/, "%{_mandir}/man3")
+ gsub(/%_man5dir/, "%{_mandir}/man5")
+ gsub(/%_man8dir/, "%{_mandir}/man8")
+
+}
+
# There should be one or two tabs after the colon.
function format_preamble()
{
return
}
+ common_macros()
+
sub("%{_defaultdocdir}", "%{_docdir}")
sub("%{_datadir}/doc", "%{_docdir}")
sub("%{_bindir}/perl", "%{__perl}")
gsub(systemduserunitdir, "%{systemduserunitdir}")
gsub(systemdtmpfilesdir, "%{systemdtmpfilesdir}")
gsub("%{_tmpfilesdir}", "%{systemdtmpfilesdir}")
+ gsub("%{_prefix}/lib/tmpfiles.d", "%{systemdtmpfilesdir}")
gsub("%{_datadir}/applications", "%{_desktopdir}")
gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}")
gsub(php_pear_dir, "%{php_pear_dir}")
gsub(php_data_dir, "%{php_data_dir}")
+ gsub("%{_datadir}/php", "%{php_data_dir}")
+ # change to %{_datadir}, with some exceptions
for (c = 1; c <= NF; c++) {
if ($c ~ datadir "/automake")
continue
gsub(datadir, "%{_datadir}", $c)
}
+ # bash completions dir, after datadir change
+ gsub("%{_datadir}/bash-completion/completions", "%{bash_compdir}")
+
gsub("%{prefix}/share", "%{_datadir}")
if (prefix"/share" == datadir)
gsub("%{_prefix}/share", "%{_datadir}")
group = replace(group, "System Tools", "Applications/System")
group = replace(group, "System", "Base")
group = replace(group, "System/Base", "Base")
+ group = replace(group, "System/Configuration/Networking", "Applications/Networking")
group = replace(group, "System/Kernel and hardware", "Base/Kernel")
group = replace(group, "System/Libraries", "Libraries")
group = replace(group, "System/Servers", "Daemons")
# bad package.xml, see http://pear.php.net/bugs/bug.php?id=17779
sub(/^php-php-gtk/, "php-gtk2", $2)
+ sub(/^rake/, "ruby-rake", $2)
+
# {{{ jpackages / fedora java packages
sub(/^antlr3$/, "java-antlr3", $2)
sub(/^aqute-bnd$/, "java-bnd", $2)
sub(/^libtevent-devel$/, "tevent-devel", $2)
sub(/^libusb1-devel$/, "libusb-devel", $2)
sub(/^libuser-python$/, "python-libuser", $2)
+ sub(/^libvirt-python$/, "python-libvirt", $2)
sub(/^libxkbfile-devel$/, "xorg-lib-libxkbfile", $2)
+ sub(/^libxml2-python$/, "python-libxml2", $2)
sub(/^mod_wsgi$/, "apache-mod_wsgi", $2)
sub(/^newt-python$/, "python-snack", $2)
sub(/^notify-python$/, "python-pynotify", $2)
sub(/^python-twisted$/, "python-TwistedCore", $2)
sub(/^python-twisted-core$/, "python-TwistedCore", $2)
sub(/^python-twisted-names$/, "python-TwistedNames", $2)
+ sub(/^python-unittest2$/, "python-modules", $2)
+ sub(/^python-uuid$/, "python-modules", $2)
sub(/^python2-devel$/, "python-devel", $2)
sub(/^pytz$/, "python-pytz", $2)
sub(/^pyxdg$/, "python-pyxdg", $2)
# {{{ suse/opensuse
sub(/^alsa-devel$/, "alsa-lib-devel", $2)
+ sub(/^libqt4-devel$/, "qt4-build, qt4-qmake, QtCore-devel", $2)
sub(/^gtk-sharp2$/, "dotnet-gtk-sharp2", $2)
sub(/^gtkmm2-devel$/, "gtkmm-devel", $2)
sub(/^libexpat-devel$/, "expat-devel", $2)
sub(/^libffmpeg-devel$/, "ffmpeg-devel", $2)
+ sub(/^libffms2-devel$/, "ffms2-devel", $2)
sub(/^libopenssl-devel$/, "openssl-devel", $2)
sub(/^libpulse-devel$/, "pulseaudio-devel", $2)
sub(/^monodoc-core$/, "mono-monodoc", $2)