return tmp
}
-function b_makekey(a, b, s) {
+function b_makekey(a, b, # parameters
+ s) { # locals
s = a "" b
# kill bcond
gsub(/[#%]+{[!?]+[_a-zA-Z0-9]+:/, "", s)
# use PLD Linux macros
$0 = fixedsub("glib-gettextize --copy --force","%{__glib_gettextize}", $0)
+ $0 = fixedsub("glib-gettextize --force --copy", "%{__glib_gettextize}", $0)
$0 = fixedsub("intltoolize --copy --force", "%{__intltoolize}", $0)
$0 = fixedsub("automake --add-missing --copy", "%{__automake}", $0)
$0 = fixedsub("automake -a --foreign --copy", "%{__automake}", $0)
$0 = fixedsub("automake -a -c --foreign", "%{__automake}", $0)
$0 = fixedsub("automake -a -c", "%{__automake}", $0)
$0 = fixedsub("libtoolize --force --automake --copy", "%{__libtoolize}", $0)
+ $0 = fixedsub("libtoolize --force --copy", "%{__libtoolize}", $0)
$0 = fixedsub("libtoolize -c -f --automake", "%{__libtoolize}", $0)
sub(/^aclocal$/, "%{__aclocal}")
}
# substitutes fixed strings (not regexps)
-function fixedsub(s1,s2,t, ind) {
+function fixedsub(s1,s2,t, # parameters
+ ind) { # locals
if (ind = index(t,s1))
t = substr(t, 1, ind-1) s2 substr(t, ind+length(s1))
return t
gsub("%{python3_sitelib}", "%{py3_sitescriptdir}")
gsub("%{python3_version}", "%{py3_ver}")
gsub("%{python2_version}", "%{py_ver}")
+ gsub("%{python3_sitearch}", "%{py3_sitedir}")
gsub(ruby_archdir, "%{ruby_archdir}")
gsub(ruby_libdir, "%{ruby_libdir}")
gsub(datadir, "%{_datadir}", $c)
}
- # bash completions dir, after datadir change
+ # completions dir, after datadir change
gsub("%{_datadir}/bash-completion/completions", "%{bash_compdir}")
+ gsub("%{_datadir}/fish/vendor_completions.d", "%{fish_compdir}")
+ gsub("%{_datadir}/zsh/site-functions", "%{zsh_compdir}")
gsub("%{prefix}/share", "%{_datadir}")
if (prefix"/share" == datadir)
gsub(/%__cat/, "cat")
gsub(/%__chmod/, "chmod")
+ gsub(/%desktop_database_postun/, "%update_desktop_database")
+ gsub(/%desktop_database_post/, "%update_desktop_database")
+
gsub("/usr/src/linux", "%{_kernelsrcdir}")
gsub("%{_prefix}/src/linux", "%{_kernelsrcdir}")
}
}
-function format_configure(line, n, a, s) {
+function format_configure(line, # parameters
+ n, a, s) { # locals
n = split(line, a, / /)
s = a[1] " \\\n"
for (i = 2; i <= n; i++) {
# insertion sort of A[1..n]
# copied from mawk manual
-function isort(A,n, i,j,hold) {
+function isort(A,n, # parameters
+ i,j,hold) { # locals
for (i = 2; i <= n; i++) {
hold = A[j = i]
while (A[j-1] > hold) {
# sentinel A[0] = "" will be created if needed
}
+function use_files_macros( # no parameters
+ i, n, t, a, l) { # locals
-function use_files_macros( i, n, t, a, l)
-{
use_macros()
# skip comments
# sourceforge urls
# Docs about sourceforge mirror system: http://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors
+ # 0. strip "#", rpm5 chops it off
+ sub("#.*", "", url)
+
# 1. unify domains
sub("^http://prdownloads\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
sub("^http://download\.sf\.net/", "http://downloads.sourceforge.net/", url)
}
}
-function get_epoch(pkg, ver, epoch)
+function get_epoch(pkg, ver, # parameters
+ epoch) # locals
{
return
# should parse the BR lines more adequately:
return epoch
}
-function format_requires(tag, value, n, p, i, deps, ndeps) {
+function format_requires(tag, value, # parameters
+ n, p, i, deps, ndeps) { # locals
# skip any formatting for commented out items or some weird macros
if (/^#/ || /%\(/) {
return tag "\t" value
BR[BR_count++] = br
}
-# Load rpm macros
+# {{{ Load rpm macros
# you should update the list also in adapter when making changes here
-function import_rpm_macros( v) {
+function import_rpm_macros( # no parameters
+ v) { # locals
# File with rpm groups
topdir = ENVIRON["_topdir"]
systemduserunitdir = ENVIRON["systemduserunitdir"]
systemdtmpfilesdir = ENVIRON["systemdtmpfilesdir"]
}
+# }}}
-# replace opam names (caml)
-function replace_opam_deps(field, name) {
+# {{{ replace opam names (caml)
+function replace_opam_deps(field, # paramters
+ name) { # locals
name = $2
if (name ~ "^(cryptokit|extlib|xmlm)$") {
name = "ocaml-" name
$2 = name
}
}
+# }}}
-# php virtual deps as discussed in devel-en
+# {{{ php virtual deps as discussed in devel-en
function replace_php_virtual_deps(field) {
pkg = $2
# if (pkg == "php-program") {
}
}
}
+# }}}
# {{{ replace_groupnames(group)
function replace_groupnames(group) {
# }}}
# {{{ replace_pkgconfig(pkg)
-function replace_pkgconfig(pkg, cmd, path, n, i, line) {
+function replace_pkgconfig(pkg, # parameters
+ cmd, path, n, i, line) { # locals
n = split("/usr/lib64/pkgconfig /usr/lib/pkgconfig /usr/share/pkgconfig", path, / /)
for (i = 1; i <= n; i++) {
cmd = "rpm -qf --qf '%{N}' " path[i] "/" pkg ".pc"
# }}}
# {{{ replace_perlmod(pkg)
-function replace_perlmod(pkg, version, cmd, line) {
+function replace_perlmod(pkg, version, # parameters
+ cmd, line) { # locals
# do nothing if version is specified
if (version) {
return
return
}
}
+# }}}
# {{{ replace_pythonegg(pkg)
-function replace_pythonegg(pkg, cmd, line) {
+function replace_pythonegg(pkg, # parameters
+ cmd, line) { # locals
cmd = "rpm -q --qf '%{N}' --whatprovides 'pythonegg(" pkg ")'"
# Getline returns 0 on end-of-file, -1 on error, otherwise 1.
if ((cmd | getline line) <= 0) {
}
# }}}
-function replace_requires(field, pkg) {
+# {{{ replace_requires
+function replace_requires(field, # parameters
+ pkg) { # locals
# strip %{?_isa}
if ($2 ~ /_isa/) {
$2 = fixedsub("%{?_isa}", "", $2);
# {{{ fedora / redhat
sub(/^Django$/, "python-django", $2)
+ sub(/^qt5-qtwebkit-devel$/, "Qt5WebKit-devel", $2)
sub(/^GitPython$/, "python-git", $2)
sub(/^MySQL-python$/, "python-MySQLdb", $2)
sub(/^NetworkManager-glib-devel$/, "NetworkManager-devel", $2)
- sub(/^python-docker-py$/, "python-docker", $2)
- sub(/^python3-docker-py$/, "python3-docker", $2)
sub(/^PyQt4-devel$/, "python-PyQt4-devel", $2)
sub(/^PyQwt-devel$/, "python-PyQwt-devel", $2)
sub(/^PyYAML$/, "python-PyYAML", $2)
sub(/^iscsi-initiator-utils$/, "open-iscsi", $2)
sub(/^kdelibs4-devel$/, "kde4-kdelibs-devel", $2)
sub(/^keyutils-libs-devel$/, "keyutils-devel", $2)
+ sub(/^lasso-python$/, "python-lasso", $2)
sub(/^libICE-devel$/, "xorg-lib-libICE-devel", $2)
sub(/^libSM-devel$/, "xorg-lib-libSM-devel", $2)
sub(/^libX11-devel$/, "xorg-lib-libX11-devel", $2)
sub(/^python-PyQt4-devel$/, "sip-PyQt4", $2)
sub(/^python-crypto$/, "python-Crypto", $2)
sub(/^python-cups$/, "python-pycups", $2)
+ sub(/^python-docker-py$/, "python-docker", $2)
sub(/^python-enchant$/, "python-pyenchant", $2)
sub(/^python-imaging$/, "python-PIL", $2)
sub(/^python-imaging-tk$/, "python-PIL-tk", $2)
sub(/^python-zope.component$/, "Zope-Component", $2)
sub(/^python-zope.interface$/, "Zope-Interface", $2)
sub(/^python2-devel$/, "python-devel", $2)
+ sub(/^python3-docker-py$/, "python3-docker", $2)
sub(/^pytz$/, "python-pytz", $2)
sub(/^pyxdg$/, "python-pyxdg", $2)
sub(/^qt4-devel$/, "qt4-build", $2)
# {{{ suse/opensuse
sub(/^alsa-devel$/, "alsa-lib-devel", $2)
+ sub(/^python-djangorestframework$/, "python-django-rest-framework", $2)
+ sub(/^python-django_compressor$/, "python-django-compressor", $2)
+ sub(/^bitstream-vera$/, "fonts-TTF-bitstream-vera", $2)
sub(/^gtk-sharp2$/, "dotnet-gtk-sharp2", $2)
sub(/^gtkmm2-devel$/, "gtkmm-devel", $2)
sub(/^libexpat-devel$/, "expat-devel", $2)
sub(/^libpulse-devel$/, "pulseaudio-devel", $2)
sub(/^libqt4-devel$/, "qt4-build, qt4-qmake, QtCore-devel", $2)
sub(/^monodoc-core$/, "mono-monodoc", $2)
+ sub(/^python-Babel$/, "python-babel", $2)
+ sub(/^python-Django$/, "python-django", $2)
+ sub(/^python-Pillow$/, "python-pillow", $2)
sub(/^python-cairo$/, "python-pycairo", $2)
sub(/^python-gobject$/, "python-pygobject", $2)
sub(/^python-gstreamer-0_10$/, "python-gstreamer", $2)
replace_opam_deps(field)
}
+# }}}
# vim:ts=4:sw=4 fdm=marker