# %package part
/^%package/, (!/^%package/ && $0 ~ SECTIONS) {
+ # FIXME: this breaks \t indenting in preamble?
gsub(/\t/, " ")
}
$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" ||
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(php_pear_dir, "%{php_pear_dir}")
gsub(php_data_dir, "%{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)