removed["CFLAGS"] = 0
removed["CXXFLAGS"] = 0
+ # get cvsaddress for changelog section
+ # using rpm macros as too lazy to add ~/.adapterrc parsing support.
+ "rpm --eval '%{?_cvsmaildomain}%{!?_cvsmaildomain:@pld-linux.org}'" | getline _cvsmaildomain
+ "rpm --eval '%{?_cvsmailfeedback}%{!?_cvsmailfeedback:PLD Team <feedback@pld-linux.org>}'" | getline _cvsmailfeedback
+
# If 1, we are inside of comment block (started with /^#%/)
comment_block = 0
# so don't adapterize when the BR/R are mixed with comments
ENVIRON["SORTBR"] == 1 && preamble == 1 && /(Build)?Requires/, /(Build)?Requires/ { # && !/^%/) {
b_idx++;
- b_ktmp = b_makekey($1, $2);
+ l = substr($0, index($0, $2));
+ b_ktmp = b_makekey($1, l);
b_key[b_idx] = b_ktmp;
b_val[b_ktmp] = $0;
if (/^%setup/) {
gsub(name, "%{name}");
gsub(version, "%{version}");
+ if (_beta) {
+ gsub(_beta, "%{_beta}");
+ }
+ if (_rc) {
+ gsub(_rc, "%{_rc}");
+ }
+ if (_snap) {
+ gsub(_snap, "%{_snap}");
+ }
}
if (/^%setup/ && /-n %{name}-%{version}( |$)/) {
skip = 0
# There should be some CVS keywords on the first line of %changelog.
if (boc == 3) {
- if (!/PLD Team/)
- print "* %{date} PLD Team <feedback@pld-linux.org>" > changelog_file
+ if ($0 !~ _cvsmailfeedback)
+ print "* %{date} " _cvsmailfeedback > changelog_file
else
skip = 1
boc = 2
if (boc == 2 && !skip) {
if (!/All persons listed below/) {
printf "All persons listed below can be reached at " > changelog_file
- print "<cvs_login>@pld-linux.org\n" > changelog_file
+ print "<cvs_login>" _cvsmaildomain "\n" > changelog_file
} else
skip = 1
boc = 1
###########
/^%pre/, (/^%[a-z]+$/ && !/^%pre/) {
preamble = 0
+
+ # %useradd and %groupadd may not be wrapped
+ if (/%(useradd|groupadd).*\\$/) {
+ a = $0; getline;
+ sub(/^[\s\t]*/, "");
+ $0 = substr(a, 1, length(a) - 1) $0;
+ }
}
+
/^%post/, (/^%[a-z]+$/ && !/^%post/) {
preamble = 0
}
}
# split (build)requires on commas
- if (field ~ /requires:/ && $2 ~ /,/) {
+ if (field ~ /requires:/ && $0 ~ /,/) {
l = substr($0, index($0, $2));
n = split(l, p, / *, */);
for (i in p) {
sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
sub("^http://dl\.sourceforge\.net/sourceforge/", "http://dl.sourceforge.net/", $2)
+ sub("^http://dl\.sf\.net/", "http://dl.sourceforge.net/", $2)
}
gsub("^make$", "%{__make}")
gsub("^make ", "%{__make} ")
+ gsub("^gcc ", "%{__cc} ")
# mandrake specs
gsub("^%make$", "%{__make}")
gsub("^%make ", "%{__make} ")
gsub("^%makeinstall_std", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
+ gsub("^%{makeinstall}", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
gsub("^%{__rm} -rf %{buildroot}", "rm -rf $RPM_BUILD_ROOT")
+ gsub("^%{__install}", "install")
+ gsub("^%{__rm}", "rm")
gsub("%optflags", "%{rpmcflags}")
gsub("%{compat_perl_vendorarch}", "%{perl_vendorarch}")