3 # This is adapter v0.27. Adapter adapts .spec files for PLD.
5 # Copyright (C) 1999-2003 PLD-Team <feedback@pld-linux.org>
7 # Micha³ Kuratczyk <kura@pld.org.pl>
8 # Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
9 # Tomasz K³oczko <kloczek@rudy.mif.pg.gda.pl>
10 # Artur Frysiak <wiget@pld-linux.org>
11 # Michal Kochanowicz <mkochano@pld.org.pl>
12 # Elan Ruusamäe <glen@pld-linux.org>
13 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
16 # - parse ../PLD-doc/BuildRequires.txt and setup proper BR epoches?
17 # - add "-nc" option to skip CVS interaction
19 # - sort Requires, BuildRequires
22 preamble = 1 # Is it part of preamble? Default - yes
23 boc = 4 # Beggining of %changelog
24 bod = 0 # Beggining of %description
25 tw = 70 # Descriptions width
27 b_idx = 0 # index of BR/R arrays
29 # If variable removed, then 1 (for removing it from export)
30 removed["LDFLAGS"] = 0
32 removed["CXXFLAGS"] = 0
34 # If 1, we are inside of comment block (started with /^#%/)
37 # File with rpm groups
38 "rpm --eval %_sourcedir" | getline groups_file
39 groups_file = groups_file "/rpm.groups"
40 system("cd `rpm --eval %_sourcedir`; cvs up rpm.groups >/dev/null")
42 # Temporary file for changelog section
43 changelog_file = ENVIRON["HOME"] "/tmp/adapter.changelog"
46 "rpm --eval %_prefix" | getline prefix
47 "rpm --eval %_bindir" | getline bindir
48 "rpm --eval %_sbindir" | getline sbindir
49 "rpm --eval %_libdir" | getline libdir
50 "rpm --eval %_sysconfdir" | getline sysconfdir
51 "rpm --eval %_datadir" | getline datadir
52 "rpm --eval %_includedir" | getline includedir
53 "rpm --eval %_mandir" | getline mandir
54 "rpm --eval %_infodir" | getline infodir
55 "rpm --eval %_examplesdir" | getline examplesdir
57 "rpm --eval %perl_sitearch" | getline perl_sitearch
58 "rpm --eval %perl_archlib" | getline perl_archlib
59 "rpm --eval %perl_privlib" | getline perl_privlib
60 "rpm --eval %perl_vendorlib" | getline perl_vendorlib
61 "rpm --eval %perl_vendorarch" | getline perl_vendorarch
62 "rpm --eval %perl_sitelib" | getline perl_sitelib
64 "rpm --eval %py_sitescriptdir" | getline py_sitescriptdir
67 # There should be a comment with CVS keywords on the first line of file.
69 if (!/# \$Revision:/) # If this line is already OK?
70 print "# $" "Revision:$, " "$" "Date:$" # No
73 next # It is enough for first line
77 # If the latest line matched /%files/
79 if ($0 !~ /defattr/) # If no %defattr
80 print "%defattr(644,root,root,755)" # Add it
82 $0 = "%defattr(644,root,root,755)" # Correct mistakes (if any)
86 function b_makekey(a, b, s) {
89 gsub("%{\\?[_a-zA-Z0-9]+:", "", s);
96 # - mixing BR/R and anything else confuses this (all will be sorted together)
98 # - comments leading the BR/R can not be associated,
99 # so don't adapterize when the BR/R are mixed with comments
100 ENVIRON["SORTBR"] == 1 && preamble == 1 && /(Build)?Requires/, /(Build)?Requires/ { # && !/^%/) {
102 b_ktmp = b_makekey($1, $2);
103 b_key[b_idx] = b_ktmp;
112 for (i = 1; i <= b_idx; i++) {
113 print "" b_val[b_key[i]];
120 /^#/ && (description == 0) {
121 if (/This file does not like to be adapterized!/) {
122 print # print this message
123 while (getline) # print the rest of spec as it is
125 do_not_touch_anything = 1 # do not touch anything in END()
129 # Generally, comments are printed without touching
135 # Remove defining _applnkdir (this macro has been included in rpm-3.0.4)
137 if ($2 == "_applnkdir")
144 /^%include.*\/usr\/lib\/rpm\/macros\.python$/ {
151 /^%description/, (/^%[a-z]+/ && !/^%description/ && !/^%((end)?if|else)/) {
154 if (/^%description/) {
161 if (description == 1 && !/^%[a-z]+/ && !/^%description/) {
163 format_flush(format_line, format_indent)
167 } else if (/^[ \t]*[-\*][ \t]*/) {
168 format_flush(format_line, format_indent)
170 format_indent = RLENGTH
171 match($0, /^[ \t]*[-\*][ \t]/)
172 format_line = substr($0, RLENGTH)
174 format_line = format_line " " $0
178 if (/^%[a-z]+/ && (!/^%description/ || bod == 2)) {
179 if (NF > 3 && $2 == "-l") {
181 for (i = 4; i <= NF; i++)
185 format_flush(format_line, format_indent)
200 /^%prep/, (/^%[a-z]+$/ && !/^%prep/ && !/^%((end)?if|else)/) {
206 if (/^%setup/ && !/-q/) {
207 sub(/^%setup/, "%setup -q")
211 gsub(name, "%{name}");
212 gsub(version, "%{version}");
215 if (/^%setup/ && /-n %{name}-%{version}( |$)/) {
216 sub(/ -n %{name}-%{version}/, "")
220 sub("^rm -rf \$RPM_BUILD_ROOT.*", "");
226 /^%build/, (/^%[a-z]+$/ && !/^%build/ && !/^%((end)?if|else)/) {
235 if (/LDFLAGS="-s"/) {
236 removed["LDFLAGS"] = 1
239 split($0, tmp, "LDFLAGS=")
240 count = split(tmp[2], flags, "\"")
241 if (flags[1] != "" && flags[1] !~ "!?debug") {
242 sub(/-s[" ]?/, "%{rpmldflags} ", flags[1])
243 $0 = tmp[1] line[1] "LDFLAGS=" flags[1] "\""
244 for (i = 2; i < count; i++)
245 $0 = $0 flags[i] "\""
251 if (cflags("CFLAGS") == 0)
255 if (cflags("CXXFLAGS") == 0)
259 if (removed["LDFLAGS"])
261 if (removed["CFLAGS"])
263 if (removed["CXXFLAGS"])
265 # Is there still something?
271 $0 = fixedsub("glib-gettextize --copy --force","%{__glib_gettextize}", $0);
272 $0 = fixedsub("intltoolize --copy --force", "%{__intltoolize}", $0);
275 $0 = fixedsub("%perl_configure", "%{__perl} Makefile.PL \\\n\tINSTALLDIRS=vendor", $0);
276 $0 = fixedsub("%perl_makecheck", "%{?with_tests:%{__make} test}", $0);
282 /^%clean/, (/^%[a-z]+$/ && !/^%clean/ && !/^%((end)?if|else)/) {
290 /^%install/, (/^%[a-z]+$/ && !/^%install/ && !/^%((end)?if|else)/) {
294 if (/^[ \t]*rm([ \t]+-[rf]+)*[ \t]+\${?RPM_BUILD_ROOT}?/ && did_rmroot==0) {
296 print "rm -rf $RPM_BUILD_ROOT"
300 if (!/^(#?[ \t]*)$/ && !/^%install/ && did_rmroot==0) {
301 print "rm -rf $RPM_BUILD_ROOT"
307 # 'install -d' instead 'mkdir -p'
309 sub(/mkdir -p/, "install -d")
311 # 'install' instead 'cp -p'
313 sub(/cp -p/, "install")
315 # No '-u root' or '-g root' for 'install'
316 if (/^install/ && /-[ug][ \t]*root/)
317 gsub(/-[ug][ \t]*root /, "")
319 if (/^install/ && /-m[ \t]*[0-9]+/)
320 gsub(/-m[ \t]*[0-9]+ /, "")
322 # No lines contain 'chown' or 'chgrp' if owner/group is 'root'
323 if (($1 ~ /chown/ && $2 ~ /root\.root/) || ($1 ~ /chgrp/ && $2 ~ /root/))
326 # No lines contain 'chmod' if it sets the modes to '644'
327 if ($1 ~ /chmod/ && $2 ~ /644/)
331 $0 = fixedsub("%buildroot", "$RPM_BUILD_ROOT", $0)
332 $0 = fixedsub("%{buildroot}", "$RPM_BUILD_ROOT", $0)
335 $0 = fixedsub("%perl_makeinstall", "%{__make} pure_install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0);
341 /^%files/, (/^%[a-z \-]+$/ && !/^%files/ && !/^%((end)?if|else)/) {
354 /^%changelog/, (/^%[a-z]+$/ && !/^%changelog/) {
358 # There should be some CVS keywords on the first line of %changelog.
361 print "* %{date} PLD Team <feedback@pld-linux.org>" > changelog_file
366 if (boc == 2 && !skip) {
367 if (!/All persons listed below/) {
368 printf "All persons listed below can be reached at " > changelog_file
369 print "<cvs_login>@pld-linux.org\n" > changelog_file
374 if (boc == 1 && !skip) {
377 print "$" "Log:$" > changelog_file
384 printf "%%define date\t%%(echo `LC_ALL=\"C\"" > changelog_file
385 print " date +\"%a %b %d %Y\"`)" > changelog_file
392 if (!/^%[a-z]+$/ || /changelog/)
393 print > changelog_file
402 /^%pre/, (/^%[a-z]+$/ && !/^%pre/) {
405 /^%post/, (/^%[a-z]+$/ && !/^%post/) {
408 /^%preun/, (/^%[a-z]+$/ && !/^%preun/) {
411 /^%postun/, (/^%[a-z]+$/ && !/^%postun/) {
414 /^%triggerin/, (/^%[a-z]+$/ && !/^%triggerin/) {
417 /^%triggerun/, (/^%[a-z]+$/ && !/^%triggerun/) {
420 /^%triggerpostun/, (/^%[a-z]+$/ && !/^%triggerpostun/) {
423 /^%pretrans/, (/^%[a-z]+$/ && !/^%pretrans/) {
426 /^%posttrans/, (/^%[a-z]+$/ && !/^%posttrans/) {
434 # There should not be a space after the name of field
435 # and before the colon.
438 if (/^%perl_module_wo_prefix/) {
441 release = "0." fixedsub(".%{disttag}.at", "", $4)
446 if (field ~ /group(\([^)]+\)):/)
448 if (field ~ /group:/) {
450 sub(/^Utilities\//,"Applications/",$2)
451 sub(/^Games/,"Applications/Games",$2)
452 sub(/^X11\/Games/,"X11/Applications/Games",$2)
453 sub(/^X11\/GNOME\/Development\/Libraries/,"X11/Development/Libraries",$2)
454 sub(/^X11\/GNOME\/Applications/,"X11/Applications",$2)
455 sub(/^X11\/GNOME/,"X11/Applications",$2)
456 sub(/^X11\/Utilities/,"X11/Applications",$2)
457 sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy",$2)
458 sub(/^Shells/,"Applications/Shells",$2)
460 sub(/^[^ \t]*[ \t]*/,"")
463 print "Group:\t\t" Grupa
464 if (Grupa ~ /^X11/ && x11 == 0) # Is it X11 application?
467 byl_plik_z_grupami = 0
469 while ((getline linia_grup < groups_file) > 0) {
470 byl_plik_z_grupami = 1
471 if (linia_grup == Grupa) {
477 if (!byl_plik_z_grupami)
478 print "######\t\t" groups_file ": no such file"
479 else if (!byl_opis_grupy)
480 print "######\t\t" "Unknown group!"
486 if (field ~ /prereq:/) {
488 $(NF + 1) = " # FIXME add Requires(scriptlet) -adapter.awk"
491 if (field ~ /packager:|distribution:|docdir:|prefix:/)
494 if (field ~ /buildroot:/)
495 $0 = $1 "%{tmpdir}/%{name}-%{version}-root-%(id -u -n)"
497 # Use "License" instead of "Copyright" if it is (L)GPL or BSD
498 if (field ~ /copyright:/ && $2 ~ /GPL|BSD/)
501 if (field ~ /name:/) {
506 if (field ~ /version:/) {
511 if (field ~ /release:/) {
516 if (field ~ /serial:/)
519 # Use %{name} and %{version} in the filenames in "Source:"
520 if (field ~ /^source/ || field ~ /patch/) {
521 n = split($2, url, /\//)
522 if (url[n] ~ /\.gz$/) {
523 url[n+1] = ".gz" url[n+1]
524 sub(/\.gz$/,"",url[n])
526 if (url[n] ~ /\.zip$/) {
527 url[n+1] = ".zip" url[n+1]
528 sub(/\.zip$/,"",url[n])
530 if (url[n] ~ /\.tar$/) {
531 url[n+1] = ".tar" url[n+1]
532 sub(/\.tar$/,"",url[n])
534 if (url[n] ~ /\.patch$/) {
535 url[n+1] = ".patch" url[n+1]
536 sub(/\.patch$/,"",url[n])
538 if (url[n] ~ /\.bz2$/) {
539 url[n+1] = ".bz2" url[n+1]
540 sub(/\.bz2$/,"",url[n])
542 if (url[n] ~ /\.logrotate$/) {
543 url[n+1] = ".logrotate" url[n+1]
544 sub(/\.logrotate$/,"",url[n])
546 if (url[n] ~ /\.pamd$/) {
547 url[n+1] = ".pamd" url[n+1]
548 sub(/\.pamd$/,"",url[n])
551 # allow %{name} just in last url component
553 for (i = 1; i <= n; i++) {
554 url[i] = fixedsub("%{name}", name, url[i])
565 url[n] = fixedsub(name, "%{name}", url[n])
567 if (field ~ /source/) {
569 url[n] = fixedsub(version, "%{version}", url[n])
572 url[n] = fixedsub(_beta, "%{_beta}", url[n])
575 url[n] = fixedsub(_rc, "%{_rc}", url[n])
578 url[n] = fixedsub(_snap, "%{_snap}", url[n])
581 $2 = fixedsub(filename, url[n], $2)
584 sub("[?]use_mirror=.*$", "", $2);
585 sub("[?]download$", "", $2);
586 sub("^http://prdownloads\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
588 sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
589 sub("^http://dl\.sourceforge\.net/sourceforge/", "http://dl.sourceforge.net/", $2)
593 if (field ~ /^source:/)
596 if (field ~ /patch:/)
601 if ($1 ~ /%define/) {
602 # Do not add %define of _prefix if it already is.
603 if ($2 ~ /^_prefix/) {
604 sub("^"prefix, $3, bindir)
605 sub("^"prefix, $3, sbindir)
606 sub("^"prefix, $3, libdir)
607 sub("^"prefix, $3, datadir)
608 sub("^"prefix, $3, includedir)
611 if ($2 ~ /_bindir/ && !/_sbindir/)
617 if ($2 ~ /_sysconfdir/ && $3 !~ /^%\(/)
621 if ($2 ~ /_includedir/)
636 if (field ~ /requires/) {
638 $0 = fixedsub("%{eversion}", "%{epoch}:%{version}-%{release}", $0);
649 if (name_seen == 0 && name) {
654 if (version_seen == 0 && version) {
655 print "Version:\t" version
659 if (release_seen == 0 && release) {
660 print "Release:\t" release
667 if (do_not_touch_anything)
670 close(changelog_file)
671 while ((getline < changelog_file) > 0)
673 system("rm -f " changelog_file)
677 if (did_clean == 0) {
680 print "rm -rf $RPM_BUILD_ROOT"
685 print "%define date\t%(echo `LC_ALL=\"C\" date +\"%a %b %d %Y\"`)"
688 if (has_changelog == 0)
692 print "* %{date} PLD Team <feedback@pld-linux.org>"
694 printf "All persons listed below can be reached at "
695 print "<cvs_login>@pld-linux.org\n"
701 function fixedsub(s1,s2,t, ind) {
702 # substitutes fixed strings (not regexps)
703 if (ind = index(t,s1))
704 t = substr(t, 1, ind-1) s2 substr(t, ind+length(s1))
708 # There should be one or two tabs after the colon.
709 function format_preamble()
712 if (match($0, /[A-Za-z0-9(),#_ \t]+[ \t]*:[ \t]*/) == 1) {
720 # Replace directly specified directories with macros
721 function use_macros()
723 gsub(perl_sitearch, "%{perl_sitearch}")
724 gsub(perl_archlib, "%{perl_archlib}")
725 gsub(perl_privlib, "%{perl_privlib}")
726 gsub(perl_vendorlib, "%{perl_vendorlib}")
727 gsub(perl_vendorarch, "%{perl_vendorarch}")
728 gsub(perl_sitelib, "%{perl_sitelib}")
730 gsub(py_sitescriptdir, "%{py_sitescriptdir}")
732 gsub(bindir, "%{_bindir}")
733 gsub("%{prefix}/bin", "%{_bindir}")
734 if(prefix"/bin" == bindir)
735 gsub("%{_prefix}/bin", "%{_bindir}")
737 for (c = 1; c <= NF; c++) {
738 if ($c ~ sbindir "/fix-info-dir")
740 gsub(sbindir, "%{_sbindir}", $c)
743 gsub("%{prefix}/sbin", "%{_sbindir}")
744 if (prefix"/sbin" == sbindir)
745 gsub("%{_prefix}/sbin", "%{_sbindir}")
747 for (c = 1; c <= NF; c++) {
748 if ($c ~ sysconfdir "/{?cron.")
750 if ($c ~ sysconfdir "/{?crontab.d")
752 if ($c ~ sysconfdir "/{?logrotate.d")
754 if ($c ~ sysconfdir "/{?pam.d")
756 if ($c ~ sysconfdir "/{?profile.d")
758 if ($c ~ sysconfdir "/{?rc.d")
760 if ($c ~ sysconfdir "/{?security")
762 if ($c ~ sysconfdir "/{?skel")
764 if ($c ~ sysconfdir "/{?sysconfig")
766 if ($c ~ sysconfdir "/{?certs")
768 gsub(sysconfdir, "%{_sysconfdir}", $c)
771 for (c = 1; c <= NF; c++) {
772 if ($c ~ datadir "/automake")
774 if ($c ~ datadir "/unsermake")
776 gsub(datadir, "%{_datadir}", $c)
780 gsub("%{prefix}/share", "%{_datadir}")
781 if (prefix"/share" == datadir)
782 gsub("%{_prefix}/share", "%{_datadir}")
784 gsub(includedir, "%{_includedir}")
785 gsub("%{prefix}/include", "%{_includedir}")
786 if (prefix"/include" == includedir)
787 gsub("%{_prefix}/include", "%{_includedir}")
789 gsub(mandir, "%{_mandir}")
790 if ($0 !~ "%{_datadir}/manual")
791 gsub("%{_datadir}/man", "%{_mandir}")
792 gsub("%{_prefix}/share/man", "%{_mandir}")
793 gsub("%{prefix}/share/man", "%{_mandir}")
794 gsub("%{prefix}/man", "%{_mandir}")
795 gsub("%{_prefix}/man", "%{_mandir}")
797 gsub(infodir, "%{_infodir}")
798 gsub("%{prefix}/info", "%{_infodir}")
799 gsub("%{_prefix}/info", "%{_infodir}")
801 if (prefix !~ "/X11R6") {
802 gsub("%{_datadir}/aclocal", "%{_aclocaldir}")
805 gsub(examplesdir, "%{_examplesdir}")
808 for (c = 1; c <= NF; c++) {
809 if ($c ~ prefix "/sbin/fix-info-dir")
811 if ($c ~ prefix "/share/automake")
813 if ($c ~ prefix "/share/unsermake")
815 gsub(prefix, "%{_prefix}", $c)
817 gsub("%{prefix}", "%{_prefix}")
820 gsub("%{PACKAGE_VERSION}", "%{version}")
821 gsub("%{PACKAGE_NAME}", "%{name}")
823 # we can move files between the dirs below
824 if ($0 !~ "%{_applnkdir}") {
825 gsub("%{_datadir}/gnome/apps", "%{_applnkdir}")
828 gsub("^make$", "%{__make}")
829 gsub("^make ", "%{__make} ")
832 gsub("^%make$", "%{__make}")
833 gsub("^%make ", "%{__make} ")
834 gsub("^%makeinstall_std", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
835 gsub("^%{__rm} -rf %{buildroot}", "rm -rf $RPM_BUILD_ROOT")
836 gsub("%optflags", "%{rpmcflags}")
837 gsub("%{compat_perl_vendorarch}", "%{perl_vendorarch}")
839 gsub("^%{__make} install DESTDIR=\$RPM_BUILD_ROOT", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
840 gsub("^fix-info-dir$", "[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>\&1")
841 $0 = fixedsub("%buildroot", "$RPM_BUILD_ROOT", $0)
842 $0 = fixedsub("%{buildroot}", "$RPM_BUILD_ROOT", $0)
843 gsub("%_bindir", "%{_bindir}")
844 gsub("%_datadir", "%{_datadir}")
845 gsub("%_iconsdir", "%{_iconsdir}")
847 gsub("/usr/src/linux", "%{_kernelsrcdir}")
848 gsub("%{_prefix}/src/linux", "%{_kernelsrcdir}")
852 # insertion sort of A[1..n]
853 # copied from mawk manual
854 function isort(A,n, i,j,hold) {
855 for (i = 2; i <= n; i++) {
857 while (A[j-1] > hold) {
862 # sentinel A[0] = "" will be created if needed
866 function use_files_macros( i, n, t, a)
868 gsub("^%{_sbindir}", "%attr(755,root,root) %{_sbindir}")
869 gsub("^%{_bindir}", "%attr(755,root,root) %{_bindir}")
872 gsub("%{_sysconfdir}/cron\.d", "/etc/cron.d")
873 gsub("%{_sysconfdir}/crontab\.d", "/etc/cron.d")
874 gsub("%{_sysconfdir}/logrotate\.d", "/etc/logrotate.d")
875 gsub("%{_sysconfdir}/pam\.d", "/etc/pam.d")
876 gsub("%{_sysconfdir}/profile\.d", "/etc/profile.d")
877 gsub("%{_sysconfdir}/rc\.d", "/etc/rc.d")
878 gsub("%{_sysconfdir}/security", "/etc/security")
879 gsub("%{_sysconfdir}/skel", "/etc/skel")
880 gsub("%{_sysconfdir}/sysconfig", "/etc/sysconfig")
881 gsub("%{_sysconfdir}/certs", "/etc/certs")
882 gsub("%{_sysconfdir}/init.d", "/etc/init.d")
884 # /etc/init.d -> /etc/rc.d/init.d
885 if (!/^\/etc\/init\.d$/) {
886 gsub("/etc/init.d", "/etc/rc.d/init.d")
889 if (/\/etc\/rc\.d\/init\.d\// && !/functions/) {
890 if (!/%attr.*\/etc\/rc\.d\/init\.d/) {
891 $0 = "%attr(754,root,root) " $0
893 if (/^%attr.*\/etc\/rc\.d\/init\.d/ && !/^%attr\(754 *,/) {
894 gsub("^%attr\\(... *,", "%attr(754,");
898 if (/lib.+\.so/ && !/^%attr.*/) {
899 $0 = "%attr(755,root,root) " $0
902 # /etc/sysconfig files
903 # %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/*
904 # attr not required, allow default 644 attr
905 if (!/network-scripts/) {
906 if (/\/etc\/sysconfig\// && /%config/ && !/%config\(noreplace\)/) {
907 gsub("%config", "%config(noreplace)")
910 if (/\/etc\/sysconfig\// && !/%config\(noreplace\)/) {
911 $NF = "%config(noreplace) " $NF
914 if (/\/etc\/sysconfig\// && /%attr\(755/) {
915 gsub("^%attr\\(... *,", "%attr(640,");
918 if (/\/etc\/sysconfig\// && !/%verify/) {
919 gsub("/etc/sysconfig", "%verify(not size mtime md5) /etc/sysconfig");
925 gsub("%attr\\(0", "%attr(")
928 if (match($0, /%verify\(not([^)]+)\)/)) {
929 t = substr($0, RSTART, RLENGTH)
930 gsub(/^%verify\(not |\)$/, "", t)
935 for (i = 1 ; i <= n; i++) {
940 gsub(/%verify\(not[^)]+\)/, s)
948 $0 = fixedsub("%{perl_man1dir}", "%{_mandir}/man1", $0);
949 $0 = fixedsub("%{perl_man3dir}", "%{_mandir}/man3", $0);
950 $0 = fixedsub("%{perl_bin}", "%{_bindir}", $0);
953 function fill(ch, n, i) {
954 for (i = 0; i < n; i++)
958 function format_flush(line, indent, newline, word, first_word) {
960 if (format_indent == -1)
963 newline = fill(" ", format_indent) "- "
965 while (match(line, /[^\t ]+/)) {
966 word = substr(line, RSTART, RLENGTH)
967 if (length(newline) + length(word) + 1 > tw) {
970 if (format_indent == -1)
973 newline = fill(" ", format_indent + 2)
978 newline = newline word
981 newline = newline " " word
983 line = substr(line, RSTART + RLENGTH)
985 if (newline ~ /[^\t ]/) {
992 if ($0 == var "=\"$RPM_OPT_FLAGS\"") {
998 sub("\$RPM_OPT_FLAGS", "%{rpmcflags}")