Initial commit

This commit is contained in:
Silvan Calarco 2011-04-26 21:39:44 +02:00
commit aa237198c2
103 changed files with 22891 additions and 0 deletions

2
.directory Normal file
View File

@ -0,0 +1,2 @@
[Desktop Entry]
Icon=folder-favorites

16
AUTHORS Normal file
View File

@ -0,0 +1,16 @@
Davide Madrisan <davide.madrisan(a)gmail.com>
main developer
frontend, plugins, libraries, documentation
porting to the libspec.lib architecture
Stefano Cotta Ramusino aka "whitone" <whitone(a)openmamba.org>
patch to check for OSI approved licenses
list of OSI approved licenses
autospec package search engine (APSE)
typo fixes in the documentation and more
Silvan Calarco <silvan.calarco(a)mambasoft.it>
heavy bug tester
sparse patches
code for building the list of build requirements
support for the multi-architecture

110
BUGS Normal file
View File

@ -0,0 +1,110 @@
*********************************
* KNOWN BUGS / MISSING FEATURES *
*********************************
* pck-update plugin
[bug] if the download fails, a HTML file is downloaded. See for instance:
http://kent.dl.sourceforge.net/sourceforge/inkscape/inkscape-0.44.tar.bz2
[security] evaluation of `%define' directives could lead to security issues
(the problem exists in the rpm itself)
[bug] '/usr/share/linuxdoc-tools/dist/linuxdoc-tools/info/mapping'
should not be considered an info page
hint: grep '/info/' is a broken test; the `file' tool cannot be used
because info pages are compressed
[bug] [silvan@buddha SPECS]$ autospec -u apt -a3 0.5.15cnc7
aggiornamento del pacchetto apt alla versione 0.5.15cnc7...
[step 3] -- dowload dei nuovi file sorgente
[1] https://moin.conectiva.com.br/AptRpm/apt-0.5.15cnc7.tar.bz2
--> /usr/src/RPM/SOURCES/apt-0.5.15cnc7.tar.bz2
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). The default
bundle is named curl-ca-bundle.crt; you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
autospec: impossibile scaricare: `apt-0.5.15cnc7.tar.bz2'
TRY USING THE CURL OPION "--no-check-certificate" (?) -- hint by Silvan Calarco
[bug] Il seguente comando:
autospec -u bbpress -a1,5,10
causa l'errore:
ERROR: pacchetto non trovato:
`/usr/src/RPM/RPMS/noarch/%sitename-website-}bbpress-0.8.2.1-2mamba.noarch.rpm'
in fase di upload.
Causa: parsing non corretto della riga (se "sitename" non è definito?)
Name: %{?sitename:%sitename-website-}bbpress
[feature] autoformat "make install" if lines are too long (like "configure")
[feature] action 8, test 4
should check if `/usr/lib/libpopt.so' --> `libpopt.so.0.0.0' is a valid link
should display a warning on broken symlinks
[feature] support the gpg signatures of rpm packages
* libspec
[feature] specfile.getvars(): missing implementation for `%ifarch' and `%ifdef'
[feature] add support for commands like:
%{expand:%%define kernel_minor_version %(echo %version | cut -d. -f3)}
example: lilo.spec
%{!?latex_doc: %define latex_doc 1}
DEBUG: resolve_rpmvars: conditional block (%if) [level#1] -- %if %latex_doc
DEBUG: resolve_boolexpr: boolean expression [ %latex_doc ]
DEBUG: resolve_boolexpr: expanding boolexpr using: name (lilo)
DEBUG: resolve_boolexpr: expanding boolexpr using: version (22.7)
DEBUG: resolve_boolexpr: boolexpr nullified -- [ %latex_doc ]
DEBUG: resolve_boolexpr: set: $1 = "%latex_doc", $2 = "", $3 = ""
expr: sintax error
example nagios.spec
%{!?EMBPERL: %define EMBPERL 0}
DEBUG: : set: $1 = "%{EMBPERL}", $2 = "", $3 = ""
expr: sintax error
* spec-create plugin
[bug] libmpcdec and http://www.directfb.org/download/DirectFB/DirectFB-0.9.22.tar.gz
do not properly detect headers path
[feature] (python specfiles)
in the `%install' block, just after the lines
python setup.py install \
--root=%{buildroot} \
--install-headers=%{_includedir}/python \
--install-lib=%{_libdir}/site-python
this command should be perhaps used
python -O %{_libdir}/python%{pyver}/compileall.py \
%{buildroot}%{_libdir}/python%{pyver}/site-packages
to optimize the python compiled code
[feature] check for non standard (/usr/lib) library files path
[feature] man pages should be splitted between main and devel packages
o man1: User programs -- main
o man2: System calls -- (kernel related --> not in standard packages)
o man3: Library functions and subroutines -- *** devel ***
o man4: Special files -- (system --> not in standard packages)
o man5: File formats -- main
o man6: Games -- main
o man7: Miscellaneous -- main (?)
o man8: System administration -- main
* missing english translation of `rpm4QiLinux-it-HOWTO', a tedious effort to
translate a doc that nobody is going to actually read.
*** NEED EXTERNAL HELP ***
******************
* IMPORTANT NOTE *
******************
Have you found a bug not listed above?
Please post a description and possibly a way to reproduce the bug to
<davide.madrisan(a)gmail.com>
If you're feeling especially nice, you should make a patch to fix the flaw.
Sending patches as attachments is preferred, but not required.

340
COPYING Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

3550
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

197
Makefile Normal file
View File

@ -0,0 +1,197 @@
# Makefile for autospec
# Copyright (C) 2004-2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
include VERSION
include Makefile.env
PACKAGE = autospec
FRONTEND = $(PACKAGE)
PACKAGE_LIB = libspec.lib
LOCALES = it
srcdir = .
distdir = $(PACKAGE)-$(VERSION)
dist_archive = $(distdir).tar.bz2
DESTDIR =
pck_conf = $(PACKAGE).conf
pck_libs := $(sort $(patsubst %.in,%,$(wildcard lib/*)))
pck_manpages := $(patsubst %.in,%,$(wildcard man/*.in man/*/*.in))
pck_plugins := $(sort $(patsubst %.in,%,$(wildcard plugins/*)))
pck_templates := $(sort $(patsubst %.in,%,$(wildcard templates/*)))
pck_tests := $(sort $(patsubst %.in,%,$(wildcard tests/*)))
pck_tools := $(sort $(patsubst %.in,%,$(wildcard tools/*)))
pck_infiles := $(wildcard *.in lib/*.in man/*.in man/*/*.in plugins/*.in templates/.in tests/* tools/*.in)
.SUFFIXES:
.SUFFIXES: .in
.in:; @echo "Generating $@...";\
sed "s,@package@,$(PACKAGE),g;\
s,@version@,$(VERSION),g;\
s,@release@,$(RELEASE),g;\
s,@frontend@,$(FRONTEND),g;\
s,@pck_lib@,$(PACKAGE_LIB),g;\
s,@pck_conf@,$(pck_conf),g;\
s,@libdir@,$(libdir),g;\
s,@sysconfdir@,$(sysconfdir),g;\
s,@plugindir@,$(plugindir),g;\
s,@templatedir@,$(templatedir),g;\
s,@testdir@,$(testdir),g;\
s,@date@,`LC_ALL="C" date "+%a %b %d %Y"`,g;\
s,@date_my@,`LC_ALL="C" date "+%B %Y"`," $< > $@
all: dist-update locales check
check: dist-update
@echo "Checking libraries and scripts for syntax errors..."
@$(MAKE) check -C plugins || exit 1
@$(MAKE) check -C tests || exit 1
@$(MAKE) check -C tools || exit 1
dist-update: $(pck_infiles:.in=)
locales:
@for loc in $(LOCALES); do\
$(MAKE) -C po/$$loc || exit 1;\
done
install-frontend: $(PACKAGE) $(pck_conf)
@echo "Installing frontend..."
@$(INSTALL_DIR) $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) $(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
@echo "Installing configuration file..."
@$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)
$(INSTALL_DATA) $(pck_conf) $(DESTDIR)$(sysconfdir)/$(pck_conf)
install-libs: $(pck_libs)
@echo "Installing libraries..."
@$(MAKE) install -C lib || exit 1
install-locales: locales
@echo "Installing localization files..."
@for loc in $(LOCALES); do\
$(MAKE) install -C po/$$loc || exit 1;\
done
install-manpages: $(pck_manpages)
@echo "Installing manpages..."
@for loc in $(LOCALES); do\
$(MAKE) install -C man/$$loc || exit 1;\
done
install-plugins: $(pck_plugins)
@echo "Installing plugins..."
@$(MAKE) install -C plugins || exit 1
install-templates: $(pck_templates)
@echo "Installing templates..."
@$(MAKE) install -C templates || exit 1
install-tests: $(pck_tests)
@echo "Installing tests..."
$(MAKE) install -C tests || exit 1
install-tools: $(pck_tools)
@echo "Installing tools..."
$(MAKE) install -C tools || exit 1
install: install-frontend \
install-libs \
install-manpages \
install-plugins \
install-templates \
install-tests \
install-tools \
install-locales
uninstall:
@echo "Uninstalling all the files..."
rm -f $(DESTDIR)$(bindir)/$(PACKAGE)
rm -f $(DESTDIR)$(sysconfdir)/$(pck_conf)
@for f in $(pck_libs); do\
echo "rm -f $(DESTDIR)$(libdir)/$${f##*/}";\
rm -f $(DESTDIR)$(libdir)/$${f##*/};\
done
@for f in $(pck_plugins); do\
echo "rm -f $(DESTDIR)$(plugindir)/$${f##*/}";\
rm -f $(DESTDIR)$(plugindir)/$${f##*/};\
done
@for f in $(pck_templates); do\
echo "rm -f $(DESTDIR)$(templatedir)/$${f##*/}";\
rm -f $(DESTDIR)$(templatedir)/$${f##*/};\
done
@for f in $(pck_tests); do\
echo "rm -f $(DESTDIR)$(testdir)/$${f##*/}";\
rm -f $(DESTDIR)$(testdir)/$${f##*/};\
done
@for f in $(pck_tools); do\
echo "rm -f $(DESTDIR)$(tooldir)/$${f##*/}";\
rm -f $(DESTDIR)$(tooldir)/$${f##*/};\
done
@for loc in $(LOCALES); do\
$(MAKE) uninstall -C man/$$loc || exit 1;\
$(MAKE) uninstall -C po/$$loc || exit 1;\
done
dist: clean
@for f in ChangeLog NEWS; do\
case `sed 15q $$f` in \
*"$(VERSION)"*) : ;; \
*) \
echo "$$f not updated; not releasing" 1>&2;\
exit 1;; \
esac; \
done
@rm -f history/$(dist_archive)
@echo "Creating the compressed tarball..."
@$(INSTALL_DIR) history
tar cf - --exclude=history -C .. $(distdir) |\
bzip2 -9 -c > history/$(dist_archive)
dist-rpm: dist $(PACKAGE).spec
@echo "Creating rpm and srpm packages..."
@rpm_name=$(PACKAGE)-$(VERSION)-$(RELEASE);\
rpm_sourcedir=`rpm --eval=%{_sourcedir} 2>/dev/null`;\
rpm_specdir=`rpm --eval=%{_specdir} 2>/dev/null`;\
for d in $$rpm_sourcedir $$rpm_specdir; do\
[ -d "$$d" ] || \
{ echo "not found: $$d" 1>&2; exit 1; };\
done;\
(cp -p history/$(dist_archive) $$rpm_sourcedir &&\
mv -f $(PACKAGE).spec $$rpm_specdir &&\
rpmbuild --clean -ba $$rpm_specdir/$(PACKAGE).spec) || exit 1
@echo "All done. Enjoy using $(PACKAGE)..."
clean: mostlyclean
rm -f history/$(dist_archive)
mostlyclean:
@echo "Cleaning up unpackaged files..."
@$(MAKE) clean -C lib || exit 1
@$(MAKE) clean -C plugins || exit 1
@$(MAKE) clean -C templates || exit 1
@$(MAKE) clean -C tests || exit 1
@$(MAKE) clean -C tools || exit 1
@for loc in $(LOCALES); do\
$(MAKE) clean -C man/$$loc || exit 1;\
$(MAKE) clean -C po/$$loc || exit 1;\
done

37
Makefile.env Normal file
View File

@ -0,0 +1,37 @@
# Makefile for autospec
# Copyright (C) 2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
prefix = /usr/local
sysconfdir = /etc
tmpdir = /tmp
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datadir = $(prefix)/share
libdir = $(datadir)/autospec/lib
localedir = $(datadir)/locale
mandir = $(datadir)/man
#plugindir = $(datadir)/autospec/plugins
plugindir = $(bindir)
templatedir = $(datadir)/autospec/templates
testdir = $(datadir)/autospec/tests
tooldir = $(bindir)
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL} -m 755
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DIR = ${INSTALL} -d -m 755

1580
NEWS Normal file

File diff suppressed because it is too large Load Diff

168
TODO Normal file
View File

@ -0,0 +1,168 @@
-- autospec, plugins ---------------------------------------------------------
Silvan Calarco <silvan.calarco@mambasoft.it> 15 février 2007 03:00
À : Davide Madrisan <davide.madrisan@gmail.com>
E' possibile con autospec configurare l'accesso in lettura al repository con
password?
Perché per inviare utilizza le impostazioni in ftp_rw_*, si logga e manda,
mentre per ricevere utilizza ftpurl_ro_* che contiene solo una url e quindi
non funzionano autospec -a1 e il backup/cancellazione dei files vecchi della
funzione -a10. Si può provare a mettere username e password nella url in un
formato di curl? Attualmente cancello a mano i vecchi pacchetti dopo averli
mandati con autospec (per fortuna quelli nel repository privato si contano
sulle dita di una mano).
In ogni caso la configurazione degli host la vedrei più semplice se fosse
organizzata tipo così:
ftp_server[0]="ftp.qilinux.it"
ftp_port[0]=
ftp_passive_mode[0]=on
ftp_user[0]=ftpqilinux
ftp_passwd[0]=*****
ftp_rpms_dir[0]="/devel/RPMS"
ftp_srpms_dir[0]="/devel/SRPMS"
ftp_olddir[0]="/devel/old"
ftp_anonymous_url_prefix[0]="ftp://ftp.qilinux.it/pub/QiLinux"
Se ftp_anonymous_url_prefix è vuota fa l'accesso con password anche in
lettura, altrimenti trova i repository accodandovi ftp_rpms_dir o
ftp_srpms_dir.
ciao,
Silvan
--
mambaSoft di Silvan Calarco - http://www.mambasoft.it
-- spec-create plugin ---------------------------------------------------------
check for non standard (/usr/lib) library files path
====================================================
SOME EXAMPLES
=============
software main-pck devel-pck
-------------------------------------------------------------------------------
a52dec-0.7.4 %{_libdir}/*.so.* %{_libdir}/*.a
%{_libdir}/*.la
%{_libdir}/*.so
liba52/Makefile.am
lib_LTLIBRARIES = liba52.la
liba52_la_SOURCES = bitstream.c imdct.c bit_allocate.c parse.c downmix.c
liba52_la_LIBADD = @LIBA52_LIBS@ -lm
liba52_la_LDFLAGS = -no-undefined
liba52/Makefile.am
noinst_LIBRARIES = libao.a
libao_a_SOURCES = audio_out.c float2s16.c ... \ ...
src/Makefile.am
a52dec_LDADD = $(top_builddir)/liba52/liba52.la \
$(top_builddir)/libao/libao.a @LIBAO_LIBS@
software main-pck devel-pck
---------------------------------------------------------------------------------------
libavifile-0.7.41 %{_libdir}/*.so.* %{_libdir}/*.a
%{_libdir}/avifile-0-7/*.a %{_libdir}/*.la
%{_libdir}/avifile-0-7/*.la %{_libdir}/*.so
%{_libdir}/avifile-0-7/*.so %{_libdir}/pkgconfig/avifile.pc
%{_libdir}/avifile-0.7/vidix/*.a
%{_libdir}/avifile-0.7/vidix/*.la
%{_libdir}/avifile-0.7/vidix/*.so
drivers/libdha/Makefile.am
if AMM_USE_VIDIX
if AMM_LINK_SHARED
lib_LTLIBRARIES = libaviplaydha.la
else
noinst_LTLIBRARIES = libdha.la
endif
endif
libaviplaydha_la_SOURCES = $(DHA_SRC)
libaviplaydha_la_LDFLAGS = -release $(AVIFILE_MAJOR_VERSION).$(AVIFILE_MINOR_VERSION) -version-info 0:$(AVIFILE_MICRO_VERSION):0
libdha_la_SOURCES = $(DHA_SRC)
drivers/vidix/drivers/Makefile.am
pkglibdir = $(libdir)/$(PACKAGE)/vidix
if AMM_USE_VIDIX
VIDIX_DRIVERS = \
libgenfb.la \
libmach64.la \
libmga_crtc2.la \
libmga.la \
libpm3.la \
libradeon.la \
librage128.la
endif
pkglib_LTLIBRARIES = $(VIDIX_DRIVERS)
VIDLIBS = $(LINK_LIBDHA) -lm
VIDLDFLAGS = -module -avoid-version
libgenfb_la_SOURCES = genfb_vid.c
libgenfb_la_LIBADD = $(VIDLIBS)
libgenfb_la_LDFLAGS = $(VIDLDFLAGS)
libmach64_la_SOURCES = mach64_vid.c
libmach64_la_LIBADD = $(VIDLIBS)
libmach64_la_LDFLAGS = $(VIDLDFLAGS)
...
software main-pck devel-pck
---------------------------------------------------------------------------------------
libimlib2-1.1.0 %{_libdir}/*.so.* %{_libdir}/*.a
%{_libdir}/loaders/filter/*.so %{_libdir}/*.la
%{_libdir}/loaders/image/*.so %{_libdir}/*.so
%{_libdir}/loaders/filter/*.a
%{_libdir}/loaders/filter/*.la
%{_libdir}/loaders/image/*.a
%{_libdir}/loaders/image/*.la
libltdl/Makefile.am
if INSTALL_LTDL
include_HEADERS = ltdl.h
lib_LTLIBRARIES = libltdl.la
else
noinst_HEADERS = ltdl.h
endif
if CONVENIENCE_LTDL
noinst_LTLIBRARIES = libltdlc.la
endif
libltdl_la_SOURCES = ltdl.c
libltdl_la_LDFLAGS = -no-undefined -version-info 3:0:0
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
libltdlc_la_LIBADD = $(LIBADD_DL)
## Because we do not have automatic dependency tracking:
ltdl.lo: ltdl.h config.h
src/Makefile.am
lib_LTLIBRARIES = libImlib2.la
libImlib2_la_SOURCES = scale.c ... \ ...
libImlib2_la_LDFLAGS = -version-info 2:0:1
if HAVE_MMX
libImlib2_la_LIBADD = $(X_OBJS) @DLLDFLAGS@ $(MMX_OBJS) \
$(top_builddir)/libltdl/libltdlc.la \
$(x_libs) $(freetype_libs) $(LDFLAGS)
libImlib2_la_DEPENDENCIES = $(top_builddir)/config.h $(X_OBJS) $(MMX_OBJS)
else
libImlib2_la_LIBADD = $(X_OBJS) @DLLDFLAGS@ \
$(top_builddir)/libltdl/libltdlc.la \
$(x_libs) $(freetype_libs) $(LDFLAGS)
libImlib2_la_DEPENDENCIES = $(top_builddir)/config.h $(X_OBJS)
endif
SYS_LOADERS_PATH = @pkglibdir@

2
VERSION Normal file
View File

@ -0,0 +1,2 @@
VERSION=1.8.0
RELEASE=1mamba

583
autospec-it-HOWTO Normal file
View File

@ -0,0 +1,583 @@
autospec HOWTO: Guida alla creazione e manutenzione di rpm con autospec
Davide Madrisan, 13 ottobre 2008
Questo documento descrive come creare ed aggiornare pacchetti rpm con
`autospec', la suite di script e moduli bash che permette di velocizzare ed
automatizzare una buona parte delle operazioni necessarie alla gestione dei
pacchetti rpm, nonchè al controllo del loro livello qualitativo ed alla
ricerca di comuni problemi di sicurezza. Autospec è stato utilizzato con
successo dagli sviluppatori delle distribuzione Linux
- QiLinux (http://www.qilinux.org)
- openmamba (http://www.openmamba.org).
Aggiornato alla versione 1.4.0 di autospec
1. Introduzione
Autospec è nato con l'intento di facilitare e sveltire le attività di
creazione e aggiornamento dei pacchetti di distribuzioni Linux basate sul
sistema di pacchettizzazione rpm. In particolare è stato in primis il tool
di QiLinux che ha permesso la creazione di specfile standard e
l'aggiornamento ed update (semi)automatico dei pacchetti già presenti nella
distribuzione QiLinux, in particolare dei pacchetti presenti nei rami
sviluppo `devel' e `devel-contrib', il ramo dei contributori esterni.
E' ora il sistema principale di manutenzione dei pacchetti adottato dagli
sviluppatori della distribuzione openmamba.
Autospec è stato strutturato in modo modulare e parametrizzato in ogni suo
aspetto e componente per permettere il suo utilizzo in qualsiasi
distribuzione basata sul sistema di pacchetti rpm, mediante la sola modifica
dei valori assegnate alle variabili presenti nel file di configurazione.
1.1. Licenza
autospec-it-HOWTO - copyright (C) 2004-2008 by Davide Madrisan.
E' concessa la copia, la distribuzione e/o modifica di questo documento
nei termini della licenza `GNU Free Documentation License', versione 1.1
od ogni successiva versione pubblicata dalla Free Software Foundation,
senza variazione delle sezioni, senza testi di Front-Cover o di
Back-Cover.
Una copia della licenza è disponibile presso
http://www.gnu.org/copyleft/fdl.html
1.2. Perchè questo documento?
Questo documento è stato creato per fornire alcune linee guida a coloro
che vogliono creare e mantenere pacchetti rpm con la suite di script
autospec. In particolare vengono descritte le procedure di creazione e di
upgrade dei pacchetti. Autospec risulta di particolare utilità nella
creazione di librerie e moduli perl ed in genere di rpm di software
pacchettizzati utilizzando gli autotools GNU (automake, autoconf, libtool).
1.3. Nuove versioni di questo documento
Il documento è archiviato sul sito FTP della distribuzione openmamba, in
particolare nel pacchetto sorgente (srpm) di autospec presente nel ramo
devel.
Si è autorizzati ed incoraggiati a spedire domande o commenti su questo
HOWTO e su autospec a Davide Madrisan <davide.madrisan(a)gmail.com>.
2. Come installare il software autospec
Autospec è disponibile in formato tarball ed in formato rpm.
In particolare gli utenti QiLinux 1.1 possono installare il pacchetto con il
comando, eseguito da utente root,
yum install autospec
ed aggiornarlo con il comando, sempre eseguito da utente root,
yum update autospec.
Per gli utenti di QiLinux-devel e QiLinux 1.2pre1 o successive release, e per
gli utenti openmamba è possibile installare o aggiornare autospec mediante il
seguente comando
apt-get install autospec
o alternativamente tramite l'interfaccia grafica `synaptic'.
Durante l'installazione viene creato un file di configurazione
/etc/autospec.conf
che è consigliabile non modificare. Per rendere autospec funzionante e
per personalizzarne il comportamento è necessario creare manualmente il
file
~/.autospec
nella propria cartella home inserendovi i **soli** dati personali e le
opzioni diverse dalle scelte di default presenti nel file principale.
Riportiamo qui di seguito un esempio di file di configurazione utente per
autospec che potrà essere utilizzato da un `contributor' come fac-simile
per creare il proprio file di configurazione personale.
[~/.autospec]
# [configuration file for `autospec']
proxy=
proxy_user=
packager_fullname="<Your Name>"
packager_email="<email>@openmamba.org"
ftp_rw_user[1]="<user>"
ftp_rw_passwd[1]="<passwd>"
arch_list=(i586 ppc arm x86_64)
curl_opts_netlink="--connect-timeout 15 --retry 3 --limit-rate 250k"
3. Funzionamento di autospec
Autospec è costruito da uno script principale di frontend ed una serie di
plugin che effettuano le operazioni di creazione di specfile, di
aggiornamento di pacchetti rpm e di estrazione di file da pacchetti rpm e
srpm. Vi sono inoltre alcune `librerie', cioè moduli contenenti funzioni
utiizzate nei plugin o utilizzabili da script creati da terze parti, su
cui non ci soffermeremo.
Autospec ed i suoi plugin sono script di shell che richiedono bash v2.0.
Il comando
autospec --help
fornisce l'elenco dei comandi disponibili. Analizzaremo nelle sezioni
seguenti alcuni di tali comandi e forniremo esempi pratici di utilizzo
di tali opzioni.
3.1. Come utilizzare autospec per la creazione di specfile
Per creare uno specfile di partenza tramite autospec è necessario
avere il sorgente del software (tarball) che si vuole pacchettizzare.
Utilizzeremo come esempio il tarball del `autospec' stesso, salvato
nella cartella `/usr/src/RPM/SOURCES/'.
La sintassi generica di autospec per la creazione di uno specfile è la
seguente:
autospec -s <tarball> [-n <name>] [-v <ver>] [-t <type>] [-o <outfile>]
dove le precedenti opzioni significano, nell'ordine:
-s, --source Cerca di creare uno specfile per il <tarball> indicato
-n, --pck-name Nome del pacchetto (default: ricavato dal nome del tarball)
-v, --pck-version Versione del pacchetto (default: ricavato dal nome del tarball)
-t, --type Categoria dello specfile da generare
standard : specfile standard (default)
gnome : specfile per pacchetti gnome
kde3 : specfile per pacchetti kde3
kde4 : specfile per pacchetti kde4
library : specfile per librerie
librarytools: specfile per librerie con tool
perl : specfile per singoli moduli perl
python : specfile per moduli python
-o, --output Redirige lo standard output sul file <outfile>
Le opzioni tra parentesi quadre sono opzionali.
Generiamo lo specfile di esempio con il comando:
autospec -s /usr/src/RPM/SOURCES/autospec-1.0.1.tar.bz2 \
-t standard -o /usr/src/RPM/SPECS/autospec.spec
o anche
autospec -s http://ftp.qilinux.it/devel/tools/autospec/autospec-0.8.8.tar.bz2 \
-t standard -o /usr/src/RPM/SPECS/autospec.spec
Viene in questo modo creato il file `/usr/src/RPM/SPECS/autospec.spec' che
contiene le istruzioni per la generazione dei pacchetti rpm e srpm del tool
autospec stesso. Nel secondo caso viene effettuato il download del software
e quindi viene creato lo specfile.
Si noti che nell'esempio è stato scelto il formato `standard' (formato di
default). Altre scelte di formato attualmente disponibili sono
- `library', per la generazione di specfile relativi a librerie,
- `perl', per la generazione di specfile relativi a moduli perl
- `python' per la creazione di specfile per pacchetti python.
Nella directory
/usr/share/autospec/templates
sono presenti i templati degli specfile per le categorie di specfile di cui
sopra.
Si noti ancora che se si omette il comando `-o', il listato dello specfile
verrà visualizzato su standard output.
Consideriamo come ulteriore esempio il comando di creazione dello specfile
della libreria avifile:
autospec -s /usr/src/RPM/SOURCES/avifile-0.7-0.7.40.tar.gz \
-t library -n libavifile -v 0.7.40
In questo caso sono state utilizzate le opzioni `-n' per forzare il nome di
specfile `libavifile' e l'opzione `-v' per forzare la versione `0.7.40'.
Tali parametri infatti non sono ricavabili da autospec in automatico
utilizzando il nome del tarball (avifile-0.7-0.7.40.tar.gz).
Si noti che, trattandosi di una libreria, si è scelto di seguire lo standard
QiLinux/openmamba che richiede che tali pacchetti abbiano sempre il prefisso
`lib'.
Completato manualmente lo specfile con un editor di testo, è possibile creare
i pacchetti rpm e srpm con il comando seguente:
autospec -u libavifile -a5
ed effettuare i test di simulazione di installazione, verifica di presenza di
alcuni tipi di vulnerabilità ed i test di qualità dei pacchetti creati:
autospec -u libavifile -a7,8
ed effettuare l'upload sul sito ftp di QiLinux, con il comando
autospec -u -a10 libavifile
se in possesso del necessario account sul branch `devel-contrib'.
Si noti che se una versione precedente è presente nel repository, questa
verrà rimossa oppure verrà spostata nella cartella `ftpdir_rw_old', se tale
variabile è definita nel/i file di configurazione.
Si veda il paragrafo successivo dove l'opzione `-u' viene esaminata in
dettaglio.
3.2. Come utilizzare autospec per aggiornare pacchetti rpm
Il tool autospec è molto utile durante la fase di aggiornamento di pacchetti rpm.
La sintassi da utilizare è la seguente:
autospec -u <pck> -a<lst> [<ver>] [<rel>] [-d v1=r1[,v2=r2,...]] \
[-l usr:pswd] [-S <specfile>] [-A <arch>] \
[--server-download <int>] [--server-upload <int>] \
[--changelog "msg" ] [--nosrpm|--norpm] \
[--force-update] [--force-build] [--force-install] \
[--ignore-test t1[,t2,...]] [-c] [-f] [-L] [-R]
dove le opzioni significano:
-u, --update Aggiorna automaticamente il pacchetto <pck>, versione <ver>
-a, --action Esegue la lista di azioni separate da virgole <lst>
0. cerca se il pacchetto è disponibile nei repository
1. download ed installazione del pacchetto srpm
2. controlla se è disponibile un aggiornamento
3. download dei nuovi file sorgente
4. aggiornamento e controllo dello specfile
5. creazione dei pacchetti rpm e srpm
6. creazione della lista dei build requirement
7. simulazione dell'installazione dei pacchetti rpm
8. esecuzione dei test di qualità e sicurezza
9. calcolo dei valori di hashing md5 e sha1
10. upload dei nuovi pacchetti sul sito ftp,
*rimozione* dei vecchi pacchetti dal sito ftp
(backup in `$ftp_rw_old_dir', se definita)
11. installazione dei nuovi pacchetti rpm
--force-update Forza l'aggiornamento dei pacchetti rpm e srpm
--force-build Ricrea comunque i pacchetti rpm e srpm
--force-install Installa i nuovi pacchetti anche in caso di errori rpm
--force Cerca di eseguire comunque le azioni specificate
--ignore-test Non esegue i test indicati (t1[,t2,...])
-d, --define Assegna alle variabili v1,v2,... i valori r1,r2,...
--server-download
Server da utilizzare nel download dei pacchetti
--server-upload Server dove effettuare l'upload dei pacchetti
--server Server per l'upload e il download dei pacchetti
-l, --login User (usr) e password (pswd) per l'upload sul sito FTP
-S, --specfile Nome dello specfile (default: <name>.spec)
-A, --arch Forza un valore per l'architettura
--changelog Scrive il messaggio indicato nel changelog del pacchetto
--nosrpm azione 5: Crea soltanto i pacchetti rpm
azione 10: Non effettua l'upload del pacchetto srpm
--norpm azione 5: Crea soltanto il pacchetto srpm
azione 10: Non effettua l'upload dei pacchetti rpm
-c, --clear Rimuove tutti i file temporanei
-f, --format Abilita la riformattazione dello specfile
-L, --log Abilita il log su file (nella directory: `$logging_dir')
-R, --rebuild Attiva modalità ed impostazioni di rebuild (azione 4)
Per aggiornare ad esempio ad esempio il pacchetto `util-linux' alla versione
2.12b, si esegua il seguente comando:
autospec -u -a1,3:5,7,8 util-linux 2.12b
E' necessario avere una connessione attiva internet poichè verranno eseguiti
i seguenti download:
step 1 : download del pacchetto corrente srpm di `util-linux' dal
primo sito indicato nei file di configurazione, o dal suo
successivo se non trovato, ecc.
step 3 : download del nuovo software, nell'esempio il tarball
`util-linux-2.12b.tar.bz2'.
In particolare, affinchè lo step `3' abbia successo, è necessario che nello
specfile sia specificata una URL completo e valida alla voce `Source' o
`Source0'.
Naturalmente è possibile eseguire solo alcuni degli step precedenti,
utilizzando l'opzione `-a' in modo opportuno.
Segnaliamo in particolare l'opzione `-f' che forza l'autoformattazione dello
specfile secondo lo standard QiLinux. Si noti che viene creata una copia di
backup del precedente specfile, in caso si voglia o debba procedere ad un suo
ripristino.
Se si ha un account in scrittura nel repository `devel' o `devel-contrib' o
un repository personale (come nel caso dei contributor in openmamba) è
possibile infine effettuare l'upload con il comando
autospec -u -a10 util-linux 2.12b
E' anche possibile utilizzare l'opzione `--server-upload' per indicare ad
autospec quale server utilizzare durante l'upload del pacchetti rpm e srpm.
Il parametro intero che questo comando richiede è l'indice del server nel
vettore `ftp_rw_server' (vedi file di configurazione).
Nota: Si noti che il comportamento predefinito di autospec prevede la
rimozione automatica dei vecchi pacchetti dal repository ftp dopo avere
effettuato l'upload delle nuove versioni.
Se tuttavia i precedenti pacchetti sono stati trovati in
`ftpurl_ro_srpms[n]' e `ftpurl_ro_rpms[n]'
e se la variabile `ftpdir_rw_old[n]' è stata configurata con un valore
non vuoto (cioè non ""), invece della rimozione autospec effettuerà il backup
dei pacchetti, utilizzando come directory radice il valore indicato in
`ftpdir_rw_old[n]'. Ad esempio se i pacchetti sono stati trovati in
ftpurl_ro_srpms[0]="ftp://ftp.qilinux.it/pub/QiLinux/devel/SRPMS"
e se sono state inizializzate in ~/.autospec le variabili seguenti
ftp_rw_server[0]="ftp.qilinux.it"
ftpdir_rw_old[0]="/devel/old"
verrà effettuerà il backup dei pacchetti sul server `ftp.qilinux.it'
nella directory /devel/old/<nomepacchetto>_<data><ora>
4. Convenzioni relative agli specfile di QiLinux e openmamba
Vengono qui elencate alcune convenzioni utilizzate negli specfile QiLinux e
openmamba che puntano ad ottenere principalmente una uniformità e facile
leggibilità degli stessi.
1. I file indicati in `Source', `Source0', `Source1', ..., che si
riferiscono a risorse internet (file presenti su server ftp o http)
devono avere indicata l'URL completa. Questo per permettere il loro
download automatico al tool `autospec' ed in generale l'immediata
reperibilità
2. I nomi delle patch dovrebbero avere la seguente struttura:
%{name}-<versione>-<descrizione>.patch
dove '<versione>' indica il numero di versione del software in cui la
patch è stata per la prima volta applicata, e `<descrizione>' indica
una stringa esplicativa dello scopo della patch.
es. %{name}-20040813-winelauncher.patch (wine-20040813)
%{name}-2.0-gcc34.patch (libfaad2-2.0)
%{name}-3.00-freetype2.patch (xpdf-3.00)
%{name}-2.03-fonts.patch
%{name}-3.00-xpdfrc.patch
%{name}-3.00-can-2004-0888.patch
Si noti un particolare l'ultima patch che si riferisce ad un fix di
sicurezza ed in cui è utilizzato come descrizione l'ID del progetto
Common Vulnerabilities and Exposures (CVE).
3. In caso di più patch può essere utile inserire una breve descrizione
delle stesse nel blocco `%prep', se possibile
es. %patch0 -p1 -b .freetype2 (xpdf-3.00)
%patch1 -p1 -b .fonts
%patch2 -p1 -b .xpdfrc
%patch3 -p1 -b .can-2004-0888
4. Nel preambolo dello specfile è necessario inserire tutti i
`BuildRequires' relativi ai pacchetti di sviluppo (devel) richiesti
durante il processo di compilazione. Per far questo occorre
controllare in modo molto attento l'output generato dallo script
`configure', se utilizzato, e la documentazione fornita con il sorgente
(generalmente i file REAME e/o REQUIREMENTS o simili).
Questo permette la ricompilazione dei pacchetti source rpm su computer
diversi da quelli su cui sono stati creati senza problemi e senza
perdita di feature (in molti casi infatti, i check falliti dello script
configure comportano la disabilitazione di feature altrimenti
supportate dal software che si desidera ricompilare).
Nota: questa pratica può significare la necessità di dover creare anche
molti pacchetti supplementari, richiesti dal software principale che si
desidera compilare per inserirlo nella distribuzione. E' bene infatti
che il software abbia attive il maggior numero di feature, in modo da
permettere il suo utilizzo pi generale possibile da parte di un utente
generico.
Nota: Se è installato il pacchetto `sudo' con una configurazione in cui
siano presenti le seguenti righe (file `/etc/sudoers')
# Cmnd alias specification
Cmnd_Alias DISTO_CMD = /usr/bin/apt-get, /bin/rpm
%packager ALL = NOPASSWD: DISTO_CMD
autospec sar<61>in grado di installare automaticamente i build requiremnts
indicati nello specfile.
5. I pacchetti devel devono generalmente avere la voce
`Requires: %{name} = %{version}'
es. %package devel
Summary: Static libraries and headers for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}
6. Utilizzare quando possibile le seguenti macro rpm
%configure
%make
%makeinstall -oppure- %makeoldinstall
in luogo rispettivamente di
./configure \
--prefix %{_prefix} \
--infodir %{_infodir} \ (se presente documentazione info)
--mandir %{_mandir} (se presente documentazione man)
...
make %{?_smp_mflags}
make install DESTDIR=%{buildroot}
make install \
prefix=%{buildroot}%{_prefix} \
exec_prefix=%{buildroot}%{_exec_prefix} \
bindir=%{buildroot}%{_bindir} \
...
Nota1: autospec v0.4.10 e successive versioni utilizzano queste macro
durante la creazione automatica degli specfile.
Nota2: se occorresse utilizzare il compilatore gcc-3.3.x invece di
quello corrente (4.x), è possibile utilizzare in QiLinux e openmamba le
macro `%configure33' e `%make33'.
Altre macro rpm disponibili sono
%install_info
%uninstall_info
Occorre utilizzarle quando nel pacchetto sono presenti pagine info.
Ad esempio (pacchetto `coreutils')
%post
%install_info coreutils.info
%preun
%uninstall_info coreutils.info
exit 0
Ed infine:
%find_lang
da utilizzarsi se il pacchetto supporta l'internazionalizzazione via
`gettext' (file /usr/share/locale/*/LC_MESSAGES/*.mo).
Ad esempio (pacchetto `tar')
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
...
%find_lang %{name}
%files -f %{name}.lang
%defattr(-,root,root)
/bin/tar
...
Si noti come l'argomento `%{name}' della macro `%find_lang' vada
sostituito dal nome effettivo dei file *.mo creati, in quei rari casi
in cui tali file hanno un nome diverso da `%{name}'.
Ad esempio (pacchetti libgtk-2.6.x)
%find_lang gtk20
...
%files -f gtk20.lang
...
Nota: E' necessario utilizzare rpm versione 4.0.4-22qilnx o successive
per potere utilizzare le macro rpm qui descritte.
7. Se si sta creando un pacchetto per modulo perl, sono disponibili
le macro rpm `%perl_sitearch' e `%perl_archlib'.
Il valore di tali variabili si può ottenere con il comando
`rpm --eval=<rpmmacro>'.
Ad esempio:
$ rpm --eval=%perl_archlib
/usr/lib/perl5/5.8.8/i386-linux-thread-multi
Se si sta creando un pacchetto python è possibile utilizzare la
macro `%python_version'
$ rpm --eval=%python_version
2.3
8. Per motivi di sicurezza è opportuno inserire nei blocchi `%prep' e
`%clear' il comando
[ "%buildroot" != / ] && rm -rf "%buildroot"
in luogo dell'istruzione `rm -rf "%buildroot"' o simili.
Questa pratica previente spiacevoli situazioni nel caso in cui i
pacchetti vengano creati dall'utente root (pratica comunque
**assolutamente sconsigliata**) e la variabile `%buildroot' sia
settata in modo errato.
9. Quando si elencano i file contenuto nei vari sottopacchetti,
utilizzare le variabili rpm, se non i nomi delle directory.
Ad esempio, utilizzare `%{_bindir}' in luogo di `/usr/bin',
`%{sbindir}' invece di `/usr/sbin'.
Per sapere quali sono le variabili rpm disponibili, utilizzare il
comando
rpm --showrc
10. Le entry del blocco '%changelog' devono rispettare la struttura
indicata dal seguente esempio:
%changelog
* Thu Aug 26 2004 Davide Madrisan <davide.madrisan@qilinux.it> 20040813-1qilnx
- udpate to 20040813
In particolare deve cioè essere presente il nome e l'indirizzo
mail del packager, seguito dalla versione corrente del pacchetto.
Nota importante: della maggior parte delle convenzioni indicate nei
punti precedenti si occupa 'autospec' in modo automatico.
5. Come contribuire allo sviluppo di autospec
Autospec è un tool in fase di sviluppo e seppur testato lungamente potrete
imbatterervi in bachi oppure trovare che alcune feature che voi reputate
utili siano mancanti.
E' possibile inviare sia bugreport che commenti e suggerimenti per
migliorare autospec al seguente indirizzo
<davide.madrisan(a)gmail.com>
I bug report devono essere dettagliati (versione di autospec, comando
eseguito, file di configurazione se necessario, URL del software, se il
problema riscontrato riguarda la creazione di uno specfile, il suo
aggiornamento, ecc.), in modo da permettere la riproducibilità del problema.
Si veda anche il file BUGS contenente un elenco dei bachi noti e feature da
implementare.
Sono naturalmente ben accette anche le patch.
Per il debugging di un problema potrebbe essere utile utilizzare l'opzione
`--debug' di autospec.
Se si desidera infine contribuire allo sviluppo diretto del tool autospec,
inviare una mail all'indirizzo indicato sopra.
6. Traduzioni
. English <http://will be available ASAP>

561
autospec.conf.in Normal file
View File

@ -0,0 +1,561 @@
# [main configuration file for `@package@']
# SECURITY WARNING: if `ftp_rw_user[*]' and `ftp_rw_passwd[*]' are set,
# this file should be only readable by the `$packager_group' group, if any
#
# *** DO NOT EDIT THIS FILE ***
# *** It will be overwritten at the next update ***
#
# Create a configuration file (.autospec) in your home directory instead,
# like this one (please customize all the values)
#
# proxy="proxyhost:8080"
# proxy_user="user:password"
# packager_fullname="Your Name"
# packager_email="email@domain"
# ftp_rw_user[1]="user"
# ftp_rw_passwd[1]="passwd"
# arch_list=(i686 ppc)
# rpm_download_and_install="sudo apt-get --quiet --yes install"
# rpm_install="sudo rpm -hUv"
# rpm_install_force="sudo rpm -hUv --force --nodeps"
# curl_opts_netlink="--connect-timeout 15 --retry 3 --limit-rate 250k"
# Name of the distribution (i.e. "openmamba")
DISTRO="openmamba"
# RPM distribution id (i.e. "mamba" --> pck-1.0-1mamba.i586.rpm)
DISTRO_rpm="mamba"
# Vendor name (i.e. "openmamba")
VENDOR="openmamba"
# Packager full name and email address (used in the Changelog)
packager_fullname=
packager_email=
# System group name for RPM packagers
packager_group="packager"
#------------------------------------------------------------------------------
# Aliases for server numbers (repositories)
ftp_alias[0]=""
ftp_alias[1]="contrib"
# Enable/Disable switch for repositories (enable by default when unset)
ftp_enable[0]=1
ftp_enable[1]=1
# FTP path of RPMS packages (i.e. "ftp://ftp.qilinux.it/pub/QiLinux/devel/RPMS")
# note: you can specify multiple choices: ftpurl_ro_rpms[0] .. ftpurl_ro_rpms[n]
ftpurl_ro_rpms[0]="http://www.openmamba.org/pub/openmamba/devel/RPMS.@arch@"
ftpurl_ro_rpms[1]="http://www.openmamba.org/pub/openmamba/devel-contrib/RPMS.@arch@"
# FTP path of SRPMS packages (i.e. "ftp://ftp.qilinux.it/pub/QiLinux/devel/SRPMS")
# note: you can specify multiple choices: ftpurl_ro_srpms[0] .. ftpurl_ro_srpms[n]
ftpurl_ro_srpms[0]="http://www.openmamba.org/pub/openmamba/devel/SRPMS.base"
ftpurl_ro_srpms[1]="http://www.openmamba.org/pub/openmamba/devel-contrib/SRPMS.base"
# FTP setup data needed when uploading RPMS and SRPMS packages
# - ftp_rw_server : name of the ftp server where package will be uploaded
# (i.e. "ftpcontrib.qilinux.it" or "ftp.qilinux.it")
# - ftp_rw_user : username to gain write access to ftp server, if any
# - ftp_rw_passwd : password to gain write access to ftp server, if any
# - ftp_rw_port : ftp port (set if a non standard ftp port is used)
# - ftp_rw_passive_mode : passive mode (can be "on" or "off" (the default))
# - ftp_rw_rpms_dir : ftp path where RPMS packages will be uploaded
# (i.e. "/RPMS", "/devel-contrib/RPMS")
# - ftp_rw_srpms_dir : ftp path where SRPMS packages will be uploaded
# (i.e. "/SRPMS", "/devel-contrib/RPMS")
#
# WARNING: the entries MUST respect the order used in `ftpurl_ro_rpms'
ftp_rw_server[0]=
ftp_rw_port[0]=
ftp_rw_passive_mode[0]=
ftp_rw_user[0]=
ftp_rw_passwd[0]=
ftp_rw_rpms_dir[0]=
ftp_rw_srpms_dir[0]=
ftp_rw_server[1]="ftp://ftpaccounts.openmamba.org"
ftp_rw_port[1]=
ftp_rw_passive_mode[1]=on
ftp_rw_user[1]="devel-contrib"
ftp_rw_passwd[1]="<hidden>"
ftp_rw_rpms_dir[1]="/RPMS.@arch@"
ftp_rw_srpms_dir[1]="/SRPMS.base"
# if no old version of the packages are found in the repositories
# `ftpurl_ro_srpms', use this one as default repository
# (its value is the index of `ftp_rw_server', default: `1')
ftp_rw_server_num_default=1
# FTP directories where old packages will be moved for backup
# (i.e. "/devel/old", "")
# IMPORTANT: SAME SIZE and ORDER as `ftp_rw_rpms_dir[]'
ftpdir_rw_old[0]=""
ftpdir_rw_old[1]=""
# list of all supported architectures (note: 'noarch' is *not* a valid arch)
arch_list[0]="i586 ppc arm x86_64"
arch_list[1]="i586"
# where to upload noarch packages
# (should be "noarch" to upload them only to the noarch subtree, or
# "${arch_list[n]}" to upload them to all the architecture subtrees
# defined for the branch <n>
arch_noarch_upload[0]="${arch_list[0]}"
arch_noarch_upload[1]="${arch_list[1]}"
#------------------------------------------------------------------------------
# Options used by curl while dowloading source files
# (default: "--connect-timeout 15 --retry 3")
# If you'd like your transfer not use your entire bandwidth you can use the
# `--limit-rate' option (for instance `--limit-rate 250k')
curl_opts_netlink="--connect-timeout 15 --retry 3"
# (default: "-L --remote-name --fail --progress-bar $curl_opts_netlink")
curl_options="-R -L --remote-name --fail --progress-bar $curl_opts_netlink"
# Sintax for 'proxy': "proxyhost:port"
proxy=""
# Sintax for 'proxy_user': "user:password"
proxy_user=""
# Commands to run when a rpm package must be automatically installed
# (NOTE: it could be necessary to manually configure sudo
# here an example (works for QiLinux and openmamba):
# Cmnd_Alias DISTRO_CMD = /usr/bin/apt-get, /bin/rpm
# %packager ALL = NOPASSWD: DISTRO_CMD
# (of course your user must belong to the `packager' group)
# Examples:
# apt : rpm_download_and_install="sudo apt-get --quiet --yes install"
# smart: rpm_download_and_install="sudo smart install --yes"
rpm_download_and_install="sudo smart install --yes"
rpm_install="sudo rpm -hUv"
rpm_install_force="sudo rpm -hUv --force --nodeps"
# Never install packages matching this regular expression
# - default value='' (can be for instance '-apidocs-')
rpm_install_noinstall_mask=''
# Mask that identify packages providing localization...
# - default value='-i18n-|-help-'
rpm_install_l10n_pck_mask='-i18n-|-help-'
# ...and only install localization packages matching this regular expression
# - default value='.*' (can be for instance 'it|pl')
rpm_install_l10n_pck_allow_lang_mask='.*'
# Options passed to rpm when installing a source rpm (srpm)
# - default value='--nodeps'
srpm_install_options='--nodeps'
# Path of the some tools commonly used in the specfiles
path_ldconfig="/sbin/ldconfig"
path_installinfo="/sbin/install-info"
#------------------------------------------------------------------------------
# Default values for some strings used in the plugins
# - default value for `Summary id'
summary_defvalue="... package summary"
# - default value for `Group id'
group_defvalue="... package group"
# - default value for `URL id'
url_defvalue="... package URL"
# - default value for `License id'
license_defvalue="... package license"
# - default value for `%description'
description_defval="... package description"
# - default value for `%description devel'
description_devel_defval="... devel package description"
# - default value for `%changelog'
changelog_samever_defvalue="... add a changelog entry"
# - default value for `%changelog' when updating a package to the same version
changelog_rebuild_defvalue="rebuilt"
changelog_userdef=""
# Allowed paths for system libraries
allowed_libdirs="\
/lib:/usr/lib:/usr/lib/qt3/lib:/usr/lib/qt4/lib:/opt/kde3/lib:/opt/kde4/lib"
# Some specfile groups and summary entries
library_group="System/Libraries"
library_summary="Static libraries and headers for %{name}"
library_group_devel="Development/Libraries"
library_group_perl="System/Libraries/Perl"
python_modules_group="System/Libraries/Python"
# Paths used in the autogenerated specfiles
#python_install_lib_path="%{_libdir}/site-python"
python_install_lib_path="%{python_sitearch}"
# File extensions for compressed man/info pages (`/usr/lib/rpm/brp-compress')
man_compress_ext=".gz"
info_compress_ext=$man_compress_ext
# Set to modify the way man pages in the autogenerated specfile are written
# "0" : all the entries (this is the default)
# "1" : one entry for each man page section
# "2" : only one entry for all the man pages
man_condensed_list=0
# Set to modify the way info pages in the autogenerated specfile are written
# "0" : all the entries (this is the default)
# "2" : only one entry for all the info pages
info_condensed_list=0
# Libraries, perl, and python modules names should have a fixed structure?
# Default values are "^lib" for libraries, "^perl-" for perl modules, and
# "^python-" for python modules. If you don't want to fix a structure for
# one of these packages, set the corresponding variable to ""
library_name_structure="^lib"
perl_module_name_structure="^perl-"
#python_module_name_structure="^python-"
python_module_name_structure=""
# Structure for the names of the patches (Patch[0-9]* ids)
# Default value: "^%\{name\}-[0-9][\.0-9a-z]*-[a-zA-Z0-9_-]+*.patch[\.gzb2]*",
# that is '%{name}-pck_version_when_first_applied-short_description.patch'
# If you don't want to fix a structure use ""
patch_name_structure="^%\{name\}-[0-9][\.0-9a-z]*-[a-zA-Z0-9_-]+*.patch[\.gzb2]*"
# Structure for the 'Source'/'Source0' id
# Default value: "\(http\|ftp\):\/\/.*\.\(tar\.gz\|tgz\|tar\.bz2\|tar\.Z\|shar\.gz\|zip\)"
# that is a full internet address of a tarball package compressed with
# either gzip or bzip2
# If you don't want to fix a structure use ""
source0_name_structure="\(http\|ftp\):\/\/.*\.\(tar\.gz\|tgz\|tar\.bz2\|tar\.Z\|shar\.gz\|zip\)"
# RPM macros for common packaging actions
rpm_macro_configure="%configure"
rpm_macro_makeinstall="%makeinstall"
# NOTE: the `make' and `makeoldinstall' are not standard rpm macros
# if are unsupported in the rpm tool you're using, you may use these settings:
# - rpm_macro_make=""
# - rpm_macro_makeoldinstall="%makeinstall"
rpm_macro_make="%make"
rpm_macro_makeoldinstall="%makeoldinstall"
# A (non standard) macro for perl modules (unset if not used)
rpm_macro_makeinstall_perl="%makeinstall_perl"
# RPM macros used to install and remove info pages
rpm_macro_installinfo="%install_info"
rpm_macro_uninstallinfo="%uninstall_info"
rpm_macro_installinfo_binary="%{__install_info}"
# RPM macros for cmake
# Default value: "%cmake -d build" (out-of-source builds)
# NOTE (in-source builds)
# rpm_macro_cmake="%cmake"
# rpm_macro_makeinstall_cmake="%makeinstall"
rpm_macro_cmake="%cmake -d build"
rpm_macro_makeinstall_cmake="%makeinstall -C build"
# RPM macros miscellaneous
# - rpm_macro_pyver: python version number
rpm_macro_pyver="%python_version"
# allowed groups
rpm_allowed_groups=(
Applications/Accessibility
Applications/Archiving
Applications/Communication
Applications/Databases
Applications/Development
Applications/Educational
Applications/Emulators
Applications/File
Applications/Fonts
Applications/Games
Applications/Graphics
Applications/Mathematics
Applications/Multimedia
Applications/Networking
Applications/Publishing
Applications/Scientific
Applications/Security
Applications/Shells
Applications/Spelling\ Checker
Applications/Text
Applications/Web
Development/Applications
Development/Bindings
Development/Debug
Development/Kernel
Development/Languages
Development/Libraries
Development/Libraries/Java
Development/Libraries/Perl
Development/Libraries/Python
Development/Tools
Documentation
Graphical\ Desktop/Applications/Accessibility
Graphical\ Desktop/Applications/Administration
Graphical\ Desktop/Applications/Archiving
Graphical\ Desktop/Applications/Configuration
Graphical\ Desktop/Applications/Databases
Graphical\ Desktop/Applications/Development
Graphical\ Desktop/Applications/Educational
Graphical\ Desktop/Applications/Environment
Graphical\ Desktop/Applications/Games
Graphical\ Desktop/Applications/Graphics
Graphical\ Desktop/Applications/Internet
Graphical\ Desktop/Applications/Multimedia
Graphical\ Desktop/Applications/Networking
Graphical\ Desktop/Applications/Office
Graphical\ Desktop/Applications/Other
Graphical\ Desktop/Applications/Publishing
Graphical\ Desktop/Applications/Scientific
Graphical\ Desktop/Applications/Security
Graphical\ Desktop/Applications/Utilities
Graphical\ Desktop/Fonts
Graphical\ Desktop/Libraries/GNOME
Graphical\ Desktop/Libraries/QT
Graphical\ Desktop/Libraries/KDE
Graphical\ Desktop/Look\ \'n\'\ feel
Graphical\ Desktop/Look\ \'n\'\ feel/Themes
Graphical\ Desktop/Look\ \'n\'\ feel/Screensavers
Installation/Update
Network/File\ Transfer
Network/File\ Systems
Network/High Availability
Network/Libraries
Network/Monitoring
Network/Routing
Network/Security
System/Benchmarks
System/Clustering
System/Configuration
System/Database
System/Kernel\ and\ Hardware
System/Kernel\ and\ Hardware/Drivers
System/Fonts
System/Hardware
System/Internationalization
System/Libraries
System/Libraries/Java
System/Libraries/Perl
System/Libraries/PHP
System/Libraries/Python
System/Management
System/Multimedia
System/Servers
System/Spooling
System/Telephony
System/Tools
System/X11)
# approved licenses
rpm_approved_licenses=(
Academic\ Free\ License\ 3.0
Adaptive\ Public\ License
Affero\ GNU\ Public\ License
Apache\ License
Apache\ License\ 2.0
Apple\ Public\ Source\ License
Artistic
Attribution\ Assurance\ Licenses
Boost\ Software\ License
BSD
Common\ Development\ and\ Distribution\ License
Common\ Public\ Attribution\ License\ 1.0
Computer\ Associates\ Trusted\ Open\ Source\ License\ 1.1
Copyright\ only
CUA\ Office\ Public\ License\ 1.0
Eclipse\ Public\ License
Educational\ Community\ License
Eiffel\ Forum\ License\ 2.0
Entessa\ Public\ License
EU\ Datagrid\ Software\ License
European\ Union\ Public\ License
Fair\ License
Frameworx\ License
GPL
Historical\ Permission\ Notice\ and\ Disclaimer
IBM\ Public\ License
IEEE
IPA\ Font\ License
ISC\ License
LGPL
Lucent\ Public\ License\ 1.02
Microsoft\ Public\ License
Microsoft\ Reciprocal\ License
MirOS Licence
MIT
Motosoto\ License
MPL\ 1.1
NASA\ Open\ Source\ Agreement\ 1.3
Naumen\ Public\ License
Nethack\ License
Nokia\ Open\ Source\ License
Non-Profit\ Open\ Software\ License\ 3.0
NTP\ License
OCLC\ Research\ Public\ License\ 2.0
Open\ Font\ License\ 1.1
Open\ Group\ Test\ Suite\ License
Open\ Software\ License\ 3.0
PHP\ License
Python
Python\ Software\ Foundation\ License
QPL
RealNetworks\ Public\ Source\ License\ 1.0
Reciprocal\ Public\ License\ 1.5
Ricoh\ Source\ Code\ Public\ License
Simple\ Public\ License\ 2.0
Sleepycat\ License
Sun\ Public\ License
Sybase\ Open\ Watcom\ Public\ License\ 1.0
University\ of\ Illinois/NCSA\ Open\ Source\ License
Vovida\ Software\ License\ 1.0
W3C\ License
wxWindows\ Library\ License
X.Net\ License
zlib/libpng
Zope\ Public\ License
OSI\ Approved
no\ OSI\ Approved
)
#------------------------------------------------------------------------------
# APSE arrays
apse_site_name[0]="http://fileforum.betanews.com"
apse_uri[0]="http://fileforum.betanews.com/search?search_advanced=Search+FileForum&os%5B%5D=12&alphabeta=R&title="
apse_put_fields[0]=""
apse_error_msg[0]="No results found\. Please try another search\."
apse_grep[0]=""
apse_sed[0]="s,.*<span>1.</span> <a href=[^ ]*>\${search_name}[^<]*[ ]\([^ <]*\)</a></h1>.*,\1,pi"
apse_site_name[1]="http://linux.softpedia.com"
apse_uri[1]="http://linux.softpedia.com/progSearch"
apse_put_fields[1]="src="
apse_error_msg[1]="No results found"
apse_grep[1]="<b[^<]*\${search_name}[^a-zA-Z]"
apse_sed[1]="s,.*<b[^<]*\${search_name}[^<]*[ ]\([^ <]*\)</b>.*,\1,pi"
apse_site_name[2]="http://www.gnomefiles.org"
apse_uri[2]="http://www.gnomefiles.org/app.php/"
apse_put_fields[2]=""
apse_error_msg[2]="We are currently making some improvements"
apse_grep[2]=""
apse_sed[2]="s,.*<B>version \([^ <]*\)</b>.*,\1,pi"
apse_site_name[3]="http://freshmeat.net"
apse_uri[3]="http://freshmeat.net/projects/"
apse_put_fields[3]=""
apse_error_msg[3]="We encountered an error"
apse_grep[3]="/releases/"
apse_sed[3]="s,.*<a href=\"\/releases\/[0-9]*\/\">\([^ <]*\)</a>.*,\1,pi"
apse_site_name[4]="http://sourcewell.berlios.de"
apse_uri[4]="http://sourcewell.berlios.de/appsearch.php?by=Importance&search="
apse_put_fields[4]=""
apse_error_msg[4]="No Application found"
apse_grep[4]="appbyid.*\${search_name}[^a-zA-Z].*Stable"
apse_sed[4]="s,.*<a href=\"appbyid.*\">\${search_name} \([^ <]*\)</a>.*,\1,pi"
apse_site_name[5]="http://distrowatch.com"
apse_uri[5]="http://distrowatch.com/packages.php?"
apse_put_fields[5]=""
apse_error_msg[5]="is currently being redesigned"
apse_grep[5]="td.*/\${search_name}[-_][0-9]"
apse_sed[5]="s,.*td><[^>]*>\([^ <]*\)<.*,\1,pi"
#------------------------------------------------------------------------------
# mode to be used when creating and updating the specfiles
rpm_specfile_mode="644"
# macro used to automatically build debug packages
rpm_macro_debug_package="%debug_package"
rpm_macro_debug_package_suffix="debug"
rpm_default_buildroot="%{_tmppath}/%{name}-%{version}-root"
# Set these variables to modify the autoformatting behaviour
# - width of the `%description blocks'
# (default: 0 (unlimited line length); was `80')
format_description_width=0
# - tab size for the entries in the specfile preamble (default: 14)
format_preamble_tab=14
# format_buildroot, format_builddir: leave blank to disable any substitutions
format_buildroot="%{buildroot}"
format_builddir="%{_builddir}"
# Use the rpm variable names for common Unix tools (default is: 0)
# i.e. %{_make}, %{__rm}, %{__ln_s}, %{__mkdir_p}, ...
format_unix_tools=0
# Extra-formatting rules (distro-specific)
format_extra_rules="\
s,\(%{_mandir}/.*man[0-9]/.*\.\)[0-8]$man_compress_ext.*,\1\*,
s,\(/usr/share/man/.*man[0-9]/.*\.\)[0-8]$man_compress_ext.*,\1\*,
s,\(%{_infodir}/.*\.\)info$man_compress_ext.*,\1\*,
s,\(/usr/share/info/.*\.\)info$man_compress_ext.*,\1\*,
s,\$RPM_BUILD_ROOT,%{buildroot},g
s,%perl_major_ver,%{perl_major_ver},g
s,%buildroot,%{buildroot},g;s,#%{buildroot}},#%buildroot},g
s,\&\& rm -rf %{buildroot},\&\& rm -rf \"%{buildroot}\",
s,test x\"%{buildroot}\" != x/,[ \"%{buildroot}\" != / ],
s,[\[]* [\"]*%{buildroot}[\"]* []]* && rm -.*,\
[ \"%{buildroot}\" != / ] \&\& rm -rf \"%{buildroot}\",
s,echo \"%doc \(\${dir#%.*\),echo \"%dir \1,
s,make[ \t]*%[{]*[?]*_smp_mflags[}]*,%make,
s,^[ \t]*\([%]*make\)[ \t]*pure_install[ \t]*$,%makeinstall_perl,
s,^perl Makefile.PL$,perl Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor,
s,\[\[ -z \"\$packlist\" \]\],\[ -z \"\$packlist\" \],"
# The standard values for the `BuildRoot' id
format_buildroot_value="%{_tmppath}/%{name}-%{version}-root"
# Enable autoformatting (disabled by default)
format_autoformat=0
# set this variable to '1' if rpm ignores the BuildRoot tag of a specfile
rpm_ignores_buildroot=1
#------------------------------------------------------------------------------
# Name of the PERL script used to generate the Makefile in perl packages
# (default is "Makefile.PL", but at least one package uses "BUILD.PL")
perl_Makefile_generator="Makefile.PL"
# Default License for perl packages
# (default is "", but can be normally set to "Artistic")
perl_License_default=""
#------------------------------------------------------------------------------
# Number of old SPEC files to keep as backup copies (history of modifications)
spec_backup_numbers=5
# Filename extension appended to backup copies ('old' by default)
spec_backup_extension="old"
# Create "hidden" (default) or "visible" backup copies
spec_backup_attr="hidden"
# Output with ascii colors (enabled by default)
# Default colors are:
# CRIT="${ESC}[1;31m" (red)
# NOTE="${ESC}[1;33m" (yellow)
# WARN="${ESC}[1;31m"
# EXIT="${ESC}[1;31m"
colorize=1
# Logging directory (default is /var/tmp/@package@)
logging_dir="/var/tmp/@package@"
#------------------------------------------------------------------------------
# List of plugins
plugindir=@plugindir@
plugin_pck_update="$plugindir/pck-update"
plugin_spec_create="$plugindir/spec-create"
plugin_pck_extract="$plugindir/pck-extract"
plugin_config_getvar="$plugindir/config-getvar"
# List of templates
templatedir="@templatedir@"
# List of tests
testdir="@testdir@"
#------------------------------------------------------------------------------
# Directories used by the rpm tool to read and save files to
srpms_dir="`rpm --eval %_srcrpmdir 2>/dev/null`"
rpms_dir="`rpm --eval %_rpmdir 2>/dev/null`"
spec_dir="`rpm --eval %_specdir 2>/dev/null`"
source_dir="`rpm --eval %_sourcedir 2>/dev/null`"
build_dir="`rpm --eval %_builddir 2>/dev/null`"
tmppath_dir="`rpm --eval %_tmppath 2>/dev/null`"

170
autospec.in Normal file
View File

@ -0,0 +1,170 @@
#!/bin/bash
# _\|/_
# (o o)
# +----oOO-{_}-OOo-----------------------------------------------------------+
# | |
# | $0 -- help creating rpm specfiles and automatically update rpm packages |
# | Copyright (C) 2004-2011 Davide Madrisan <davide.madrisan@gmail.com> |
# | |
# | This program is free software; you can redistribute it and/or modify it |
# | under the terms of the GNU General Public License version 2 as published |
# | by the Free Software Foundation. There is NO warranty; not even for |
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
# | |
# | Report bugs to <davide.madrisan@gmail.com> |
# | |
# +--------------------------------------------------------------------------+
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
{ echo $"this script requires bash version 2 or better" >&2 && exit 1; }
me=(${0##*/} "@version@" "@date@")
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="@package@_fe"; export TEXTDOMAIN
# default values
let "pck_update = 0"
let "pck_extract = 0"
let "spec_create = 0"
let "config_getvar = 0"
let "print_help = 0"
let "print_version = 0"
function autospec.version() {
echo "\
${me[0]} ${me[1]}
Copyright (C) 2004-2011 Davide Madrisan <davide.madrisan@gmail.com>"
}
function autospec.copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function autospec.usage() {
# $1: optional exit code (default is '1')
autospec.version
echo "
"$"Automatically update rpm packages and help creating new specfiles.""
"$"Operation modes"":
-u, --update "$"Update the given package to a specified version and release""
-s, --source "$"Try to create a specfile for the specified tarball""
-x, --extract "$"Extract a given file or list of files from a srpm archive""
--eval "$"Print the value of the given configuration variable""
-h, --help "$"Print this help, then exit""
-V, --version "$"Print version number, then exit""
-q, --quiet "$"Run in quiet mode""
-r, --colorize "$"Enable the colorized output""
-D, --debug "$"Run in debugging mode (very verbose output)""
"$"Usage"":
"$"Use '-u -h', '-s -h', '-x -h', and '--eval -h' to display specific command line options.""
"$"Report bugs to <davide.madrisan@gmail.com>."
exit ${1:-1}
}
[ $# -eq 0 ] && autospec.usage
# load the warning/error/debug/ message handling library
# to define the 'notify()' function
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
notify.disable_colors
# load the configuration file(s)
[ -r @libdir@/libcfg.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libcfg.lib" 1>&2
exit 1; }
. @libdir@/libcfg.lib
for arg in $@; do
case $arg in
-u|--update)
let "pck_update = 1" ;;
-s|--source)
let "spec_create = 1" ;;
-x|--extract)
let "pck_extract = 1" ;;
--eval|--eval=*)
let "config_getvar = 1" ;;
-D|--debug)
let "verbose = 2" ;;
-q|--quiet)
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
-h|--help)
let "print_help = 1" ;;
-V|--version)
let "print_version = 1" ;;
*) ;;
esac
done
case "$(( $pck_update + $spec_create + $pck_extract + $config_getvar ))" in
0) [ "$print_help" = "1" ] && autospec.usage 0
if [ "$print_version" = "1" ]; then
# only print the version number in quiet mode
[ "$verbose" = 0 ] && { echo "${me[1]}"; exit 0; }
autospec.version;
autospec.copying
exit 0;
fi
autospec.usage 1 ;;
1) ;;
*) autospec.usage 1 ;;
esac
[ "$logging" = "1" ] && let "colorize = 0"
[ "$colorize" = "1" ] && notify.enable_colors
notify.debug "[${me[0]}, "$"version"" ${me[1]}]"
# checking for errors in the configuration file
[ "$config_getvar" = 1 ] || config.integrity
# load and execute the required plugin...
[ "$config_getvar" = 1 ] && plugin_to_run="$plugin_config_getvar"
[ "$pck_extract" = 1 ] && plugin_to_run="$plugin_pck_extract"
[ "$spec_create" = 1 ] && plugin_to_run="$plugin_spec_create"
[ "$pck_update" = 1 ] && plugin_to_run="$plugin_pck_update"
[ -n "$plugin_to_run" ] ||
notify.error "\`$plugin_to_run': "$"unset in the configuration files"
[ -x "$plugin_to_run" ] ||
notify.error $"plugin not found"": \`$plugin_to_run'"
tmpargfile=$(mktemp -q -t $me.XXXXXXXX)
[ $? -eq 0 ] || notify.error $"can't create temporary files"
notify.debug "tmpargfile = \`${NOTE}$tmpargfile${NORM}'"
# workaround to bypass the issues related to bash expansion in multi-word
# strings (ex: autospec -u s.spec -a4 1.0 --changelog "here's the problem")
echo -n "set -- " > $tmpargfile
while [ $# -gt 0 ]; do
echo -n "\"$1\" " >> $tmpargfile
shift
done
echo >> $tmpargfile
notify.debug "\
running: \`$plugin_to_run --autospec-args-file=$tmpargfile'"
$plugin_to_run --autospec-args-file=$tmpargfile
exit $?

568
autospec.spec.in Normal file
View File

@ -0,0 +1,568 @@
# please customize this directive (or use root if your distro does not have
# such a group)
%define packager_group packager
Name: autospec
Version: @version@
Release: @release@
Summary: Create specfiles and automatically update/check/fix rpm packages
Summary(it): Crea specfile ed aggiorna/controlla/corregge in modo automatico pacchetti rpm
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://www.openmamba.org/packages.html
Source: autospec-%{version}.tar.bz2
Requires(pre): rpm
Requires: cpio, coreutils, curl, findutils, grep, sed
Requires: /bin/mktemp
Requires: /usr/bin/getopt
Requires: /usr/bin/host
Requires: bzip2
Requires: gzip
Requires: unzip
#Requires: sudo
Requires: ftp
Requires: %{name}-plugins = %{?epoch:%epoch:}%{version}-%{release}
License: GPL
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Autospec is a tool for automatically generating specfiles and updating rpm packages.
Install autospec if you are a packager or you just want to build/upgrade rpm packages in an easy and quick way.
%description -l it
Autospec è un tool in grado di generare in modo automatico specfile ed aggiornare pacchetti rpm.
Installa autospec se sei un packager o se vuoi creare/aggiornare pacchetti rpm in modo semplice e rapido.
%package plugins
Summary: Autospec plugins
Summary(it): Plugin di autospec
Group: Development/Tools
Requires: %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-tests = %{?epoch:%epoch:}%{version}-%{release}
Requires(pre): rpm
%description plugins
This package contains the plugins needed for generating specfiles, updating rpm packages, and extracting files from a source rpm package.
%description -l it plugins
Questo pacchetto contiene i plugin necessari per generare specfile, aggiornare pacchetti rpm, estrarre file da pacchetti source rpm (srpm).
%package libs
Summary: Autospec libraries
Summary(it): Librerie di autospec
Group: Development/Tools
%description libs
This package contains the library functions needed by autospec, and their plugins.
They can be used by external tools that manage rpm packages and specfiles.
%description -l it libs
Questo pacchetto contiene le librerie necessarie al funzionamento di autospec e dei suoi plugin.
Possono anche essere stilizzate da tool esterni che lavorano su rpm e specfile.
%package tests
Summary: Autospec tests
Summary(it): Test per autospec
Group: Development/Tools
%description tests
This package contains the tests to check rpm packages for quality and security issues.
%description -l it tests
Questo pacchetto contiene i test per il controllo di qualità e sicurezza dei pacchetti rpm.
Possono anche essere stilizzate da tool esterni che lavorano su rpm e specfile.
%package tools
Summary: Autospec extra tools
Summary(it): Programmi extra basati su autospec
Group: Development/Tools
Requires: %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
%description tools
This package contains some extra tools.
%description -l it tools
Questo pacchetto contiene alcuni script extra.
%prep
%setup -q
%build
make prefix=%{_prefix}
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
make install DESTDIR=%{buildroot} prefix=%{_prefix}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/%{name}
%lang(it) %{_mandir}/it/man1/autospec.*
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/autospec_fe.mo
%doc AUTHORS BUGS ChangeLog COPYING NEWS TODO
%doc autospec-it-HOWTO
%files plugins
%defattr(-,root,root)
%{_bindir}/config-getvar
%{_bindir}/pck-extract
%{_bindir}/pck-update
%{_bindir}/spec-create-old
%{_bindir}/spec-create
%if %{packager_group} == "root"
%config %attr(644,root,root) %{_sysconfdir}/%{name}.conf
%else
%config %attr(640,root,%{packager_group}) %{_sysconfdir}/%{name}.conf
%endif
%{_datadir}/%{name}/templates/*
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/config-getvar.mo
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/pck-extract.mo
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/pck-update.mo
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/spec-create.mo
%files libs
%defattr(-,root,root)
%{_datadir}/%{name}/lib/*
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/lib*.mo
%files tests
%defattr(-,root,root)
%{_datadir}/%{name}/tests
%lang(it) %{?_localedir:%{_localedir}}%{!?_localedir:%_datadir/locale}/it/LC_MESSAGES/test??_*.mo
%files tools
%defattr(-,root,root)
%{_bindir}/extract-specs
%{_bindir}/autoupdate-*
%{_bindir}/kde4-flist2rpmvars
%changelog
* @date@ Davide Madrisan <davide.madrisan@gmail.com> @version@-@release@
- update to @version@
* Thu Feb 10 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 1.7.2-2mamba
- restored requirements for autospec-plugins, autospec-libs and autospec-tests
- removed %dir entry for non empty directories
* Sat Dec 15 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.7.2-1mamba
- update to 1.7.2
* Wed Dec 29 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.7.1-1mamba
- update to 1.7.1
* Wed Dec 22 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.7.0-1mamba
- update to 1.7.0
* Tue Nov 28 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.6.3-1mamba
- update to 1.6.3
* Tue Nov 02 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.6.2-1mamba
- update to 1.6.2
* Fri Oct 22 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.6.1-1mamba
- update to 1.6.1
* Wed Oct 06 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.6.0-1mamba
- update to 1.6.0
* Sat Aug 21 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-11mamba
- added patch get_default_arch_from_rpm that uses rpm --eval %%{_host_cpu} to find default architecture
* Mon Aug 16 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-10mamba
- added noarch_allow_upload_to_given_arch_only-2 patch to fix noarch support also for operations 6,7 and 11
* Thu Aug 12 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-9mamba
- patch noarch_allow_upload_to_given_arch_only: support configuration of @arch@ in arch_no_arch_upload
* Mon Aug 09 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-8mamba
- patch replace_obsolete_PreReq: replace obsolete PreReq tags with Requires(pre) or Requires(post)
* Sun Aug 08 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-7mamba
- added hidden_spec_old_file patch: create specfile backups as old files (i.e. prefixed by '.')
- patch fix_undefined_SPECFILE_PREPROCESSED: infofile.create bug when specfile_preprocessed already exists
* Wed Aug 04 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-6mamba
- added PreReq for rpm also to autospec-plugins package
* Wed Aug 04 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-5mamba
- added patch dont_backup_srpm_with_nosrpm_option to make it work better with multiarch uploads
* Mon Aug 02 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-4mamba
- added patch: use rpm option --whatprovides to find unidentified requirements
* Mon Aug 02 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-3mamba
- added patch to replace apt with smart in default configured application for rpm download and installation
* Sat Jul 31 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.0-2mamba
- added patch install_srpms_with_nodeps for compatibility with rpm5
* Mon Jul 19 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.5.0-1mamba
- update to 1.5.0
* Thu Jul 01 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.4.17-4mamba
- patch: reduce severity from error to warning if host command fails as happens using qemu-arm environment
* Thu Jul 01 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.4.17-3mamba
- added fix_get_RPMS_name patch to fix identification of old packages to backup
* Thu Jun 17 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.4.17-2mamba
- added PreReq for rpm for correct user configuration
- added patches: curl_pass_netlink_opts and rpm-whatprovides-optimize
* Fri May 14 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.17-1mamba
- update to 1.4.17
* Thu Apr 15 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.16-1mamba
- update to 1.4.16
* Wed Mar 24 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.15-1mamba
- update to 1.4.15
* Sat Mar 13 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.14-1mamba
- update to 1.4.14
* Wed Feb 17 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.13-1mamba
- update to 1.4.13
* Wed Feb 17 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.12-1mamba
- update to 1.4.12
* Tue Jan 12 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.11-1mamba
- update to 1.4.11
* Thu Jan 10 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.4.10-1mamba
- update to 1.4.10
* Fri Oct 23 2009 Davide Madrisan <davide.madrisan@gmail.com> 1.4.9-1mamba
- update to 1.4.9
* Wed Oct 14 2009 Davide Madrisan <davide.madrisan@gmail.com> 1.4.8-1mamba
- update to 1.4.8
* Sun Jul 05 2009 Davide Madrisan <davide.madrisan@gmail.com> 1.4.7-1mamba
- update to 1.4.7
* Sun Apr 19 2009 - Silvan Calarco <silvan.calarco@mambasoft.it> (1.4.6-3mamba)
- applied a fix to the relocate_RPM_dirs patch
* Sat Apr 18 2009 - Silvan Calarco <silvan.calarco@mambasoft.it> (1.4.6-2mamba)
- added relocate_RPM_dirs patch
* Fri Apr 10 2009 Davide Madrisan <davide.madrisan@gmail.com> 1.4.6-1mamba
- update to 1.4.6
* Sun Feb 15 2009 Davide Madrisan <davide.madrisan@gmail.com> 1.4.5-1mamba
- update to 1.4.5
- add missing %%defattr in 'plugins' subpackage
* Thu Dec 23 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.4.4-1mamba
- update to 1.4.4 (Christmas Release)
* Thu Nov 20 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.4.3-1mamba
- update to 1.4.3
* Fri Nov 14 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.4.2-1mamba
- update to 1.4.2
* Wed Oct 29 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.4.1-1mamba
- update to 1.4.1
* Mon Oct 13 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.4.0-1mamba
- update to 1.4.0
- new subpackages plugins libs tools
* Fri Oct 03 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.3.2-1mamba
- update to 1.3.2
* Tue Sep 30 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.3.1-1mamba
- update to 1.3.1
* Mon Sep 01 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.3.0-1mamba
- update to 1.3.0
* Fri Aug 15 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.2.2-1mamba
- update to 1.2.2
* Fri Jun 13 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.2.1-1mamba
- update to 1.2.1
* Sun May 11 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.2.0-1mamba
- update to 1.2.0
- plugins moved to %{_datadir}/%{name}/plugins
- install autospec templates %{_datadir}/%{name}/templates
* Fri Feb 29 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.1.9-1mamba
- update to 1.1.9
* Wed Jan 30 2008 Davide Madrisan <davide.madrisan@gmail.com> 1.1.8-1mamba
- update to version 1.1.8
* Sat Dec 31 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.7-1mamba
- update to version 1.1.7
* Sun Dec 23 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.6-1mamba
- update to version 1.1.6
* Fri Dec 14 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.5-1mamba
- update to version 1.1.5
* Mon Dec 10 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.4-1mamba
- update to version 1.1.4
* Sun Dec 02 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.3-1mamba
- update to version 1.1.3
* Thu Nov 29 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.2-1mamba
- update to version 1.1.2
* Mon Nov 26 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.1-1mamba
- update to version 1.1.1
- add requirement for ftp
* Tue Nov 20 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.1.0-1mamba
- update to version 1.1.0
* Tue Nov 13 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.0.2-1mamba
- update to version 1.0.2
* Fri Oct 26 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.0.1-1mamba
- update to version 1.0.1
- do not use the %%makeinstall macro for compatibility with other distros
* Wed Sep 26 2007 Davide Madrisan <davide.madrisan@gmail.com> 1.0-1mamba
- update to version 1.0
* Sat Sep 08 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.99-2mamba
- patch: remove protocol prefix (http:// ftp://) before checking server dns reachability
* Thu Sep 06 2007 Davide Madrisan <davide.madrisan@gmail.com> 0.9.99-1mamba
- update to version 0.9.99 by autospec
* Thu Jun 07 2007 Davide Madrisan <davide.madrisan@gmail.com> 0.9.98-1mamba
- update to version 0.9.98 by autospec
* Sat May 05 2007 Davide Madrisan <davide.madrisan@gmail.com> 0.9.97-1mamba
- update to version 0.9.97 by autospec
* Tue Apr 24 2007 Davide Madrisan <davide.madrisan@gmail.com> 0.9.96-1mamba
- update to version 0.9.96 by autospec
* Tue Mar 27 2007 Davide Madrisan <davide.madrisan@gmail.com> 0.9.95-1mamba
- update to version 0.9.95 by autospec
* Thu Mar 01 2007 Davide Madrisan <davide.madrisan@gmail.com> 0.9.94-1qilnx
- update to version 0.9.94 by autospec
* Fri Feb 09 2007 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.93-1qilnx
- update to version 0.9.93 by autospec
* Mon Jan 29 2007 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.92-1qilnx
- update to version 0.9.92 by autospec
* Tue Jan 09 2007 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.91-1qilnx
- update to version 0.9.91 by autospec
* Thu Dec 21 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.90-1qilnx
- update to version 0.9.90 by autospec
* Wed Nov 29 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.14-1qilnx
- update to version 0.9.14 by autospec
- ncompress tool removed from the list of static requirements
- do require /bin/mktemp instead of /usr/bin/mktemp for portability
* Mon Nov 06 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.13-1qilnx
- update to version 0.9.13 by autospec
* Mon Jun 19 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.12-1qilnx
- update to version 0.9.12 by autospec
* Sun Jun 11 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.11-1qilnx
- update to version 0.9.11 by autospec
- new documentation file `autobuild_example.rules'
* Wed May 31 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.10-1qilnx
- update to version 0.9.10 by autospec
* Tue May 16 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.9-1qilnx
- update to version 0.9.9 by autospec
* Mon May 08 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.8-1qilnx
- update to version 0.9.8 by autospec
* Mon Apr 17 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.7-1qilnx
- update to version 0.9.7 by autospec
* Mon Mar 20 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.6-1qilnx
- update to version 0.9.6 by autospec
* Sun Mar 05 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.5-1qilnx
- update to version 0.9.5 by autospec
* Fri Feb 03 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.4-1qilnx
- update to version 0.9.4 by autospec
* Sat Jan 14 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.3-1qilnx
- update to version 0.9.3 by autospec
- requires rpm >= 4.4.4
* Sun Jan 01 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.2-1qilnx
- update to version 0.9.2 by autospec
* Sun Dec 18 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.1-1qilnx
- update to version 0.9.1 by autospec
* Thu Dec 15 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.0-1qilnx
- update to version 0.9.0
* Sat Dec 03 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.9-1qilnx
- update to version 0.8.9
* Sat Nov 26 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.8-qilnx
- update to version 0.8.8
* Thu Nov 24 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.7-qilnx
- update to version 0.8.7
- fixed typo in license tag
* Sun Nov 20 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.6-qilnx
- update to version 0.8.6
* Tue Nov 15 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.5-qilnx
- update to version 0.8.5
* Thu Nov 10 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.4-qilnx
- update to version 0.8.4
- requires host
* Sun Nov 06 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.3-1qilnx
- update to version 0.8.3
- requires cpio
* Sun Oct 30 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.2-1qilnx
- update to version 0.8.2
* Sun Oct 16 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.1-1qilnx
- update to version 0.8.1
* Mon Oct 09 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.8.0-1qilnx
- update to version 0.8.0
* Sun Oct 02 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.7.3-1qilnx
- update to version 0.7.3
- added more runtime requirements
* Fri Sep 30 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.7.2-1qilnx
- update to version 0.7.2
- requires sudo
* Wed Sep 28 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.7.1-1qilnx
- update to version 0.7.1
* Sat Sep 24 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.7.0-1qilnx
- update to version 0.7.0
* Wed Aug 31 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.6.4-1qilnx
- update to version 0.6.4
* Fri Aug 05 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.6.3-1qilnx
- update to version 0.6.3
* Fri Jul 29 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.6.2-1qilnx
- update to version 0.6.2
* Sat May 28 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.6.1-1qilnx
- update to version 0.6.1
* Mon Apr 25 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.6.0-1qilnx
- update to version 0.6.0
* Sat Apr 09 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.5.4-1qilnx
- update to version 0.5.4
* Fri Mar 25 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.5.3-1qilnx
- update to version 0.5.3
* Sun Mar 21 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.5.2-1qilnx
- update to version 0.5.2
* Sun Mar 13 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.5.1-1qilnx
- update to version 0.5.1
* Fri Mar 11 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.5.0-1qilnx
- update to version 0.5.0
* Fri Mar 02 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.15-1qilnx
- update to version 0.4.15
* Tue Feb 15 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.14-1qilnx
- update to version 0.4.14
* Sat Jan 29 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.13-1qilnx
- update to version 0.4.13
* Mon Jan 24 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.12-1qilnx
- update to version 0.4.12
* Sun Jan 16 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.11-1qilnx
- update to version 0.4.11
* Sun Jan 09 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.10-1qilnx
- update to version 0.4.10
* Thu Dec 16 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.9-2qilnx
- added BUGS to %%docs
* Wed Dec 15 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.9-1qilnx
- update to version 0.4.9
* Sun Nov 14 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.8-1qilnx
- update to version 0.4.8
* Sun Oct 24 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.7-1qilnx
- update to version 0.4.7 by autospec
* Tue Oct 19 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.6-1qilnx
- update to version 0.4.6 by autospec
* Thu Oct 14 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.5-1qilnx
- update to version 0.4.5 by autospec
* Wed Oct 06 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.4-1qilnx
- update to version 0.4.4 by autospec
* Tue Oct 05 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.3-1qilnx
- update to version 0.4.3 by autospec
- added the document rpm4QiLinux-it-HOWTO
* Mon Oct 04 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.2-1qilnx
- update to version 0.4.2 by autospec
* Fri Oct 01 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.1-1qilnx
- update to version 0.4.1
* Mon Sep 13 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.4.0-1qilnx
- update to version 0.4.0
* Tue Sep 01 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.3.9-1qilnx
- update to version 0.3.9
* Fri Aug 27 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.3.8-1qilnx
- update to version 0.3.8
* Wed Aug 25 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.3.7-1qilnx
- update to version 0.3.7
* Wed Aug 20 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.3.6-1qilnx
- update to version 0.3.6
* Sat Aug 09 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.3.5-1qilnx
- update to version 0.3.5
* Thu Aug 05 2004 Davide Madrisan <davide.madrisan@qilinux.it> 0.3.4-1qilnx
- first public release

45
lib/Makefile Normal file
View File

@ -0,0 +1,45 @@
# Makefile for autospec
# Copyright (C) 2008,2010 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ..
include $(srcdir)/Makefile.env
pck_libs := libapse.lib libcfg.lib libmsgmng.lib libnetwork.lib libspec.lib README.API
pck_libs_infiles := $(wildcard *.in)
all:
check: $(pck_libs)
@for f in $(pck_libs); do\
echo -n "checking $$f... ";\
bash -n $$f \
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
install: $(pck_libs)
@$(INSTALL_DIR) $(DESTDIR)$(libdir)
for f in $(pck_libs); do\
$(INSTALL_DATA) $${f} $(DESTDIR)$(libdir)/$${f};\
done
uninstall:
for f in $(pck_libs); do\
rm -f $(DESTDIR)$(libdir)/$${f};\
done
clean:
rm -f $(patsubst %.in,%,$(pck_libs_infiles))

6
lib/README.API.in Normal file
View File

@ -0,0 +1,6 @@
# TO DO, sorry...
# try with:
# . @libdir@/libspec.lib
# EXIT_FUNC=return
# specfile.getvars --help

533
lib/libapse.lib.in Normal file
View File

@ -0,0 +1,533 @@
#!/bin/bash
# libapse.lib -- Autospec Package Search Engine library
# Copyright (C) 2007 Stefano Cotta Ramusino <stefano.cotta@openmamba.org>
# Copyright (C) 2008,2009,2010 Silvan Calarco <silvan.calarco@mambasoft.it>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
[ -r @libdir@/libspec.lib ] ||
{ echo "$me: "$"library not found"": /usr/share/autospec/lib/libspec.lib" 1>&2
exit 1; }
. @libdir@/libspec.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="libapse"; export TEXTDOMAIN
# function apse.cmpversion()
# compare two version
# args:
# $1 : first version
# $2 : second version
# $3 : changelog of first version
# $4 : changelog of second version
# returns:
# 0 : same version
# 1 : first version is greater than the second one
# 2 : second version is greater than the first one
function apse.cmpversion() {
local retval=1
[ "$1" = "$2" ] && retval=0
if [ "$retval" = "0" ]; then
notify.debug "$FUNCNAME: retval = \"$retval\""
return $retval
fi
local vcs prealpha beta rc stable precedence \
version1 version2 minfield maxfield field1 field2 \
retval code1 code2 subarra1 position
let "position = 7"
vcs=(\
"cvs" "svn" "git" "rcs" "bzr" "mtn" "ae")
prealpha=(\
"prealpha" "nightlybuild" "development" "dev" ${vcs[*]})
beta=(\
"beta" "preview" "pre" "prototype" "proto" "tp" "ctp" "ea" "test" "milestone")
rc=(\
"rc" "gm" "gamma")
stable=(\
"stable" "gold" "gar" "rtm" "rtw" "rel")
precedence=(\
"prealpha[*]" "alpha" "beta[*]" "rc[*]" "delta" "omega" "stable[*]")
# TODO: if there isn't in this list compare alphabetically
# TODO: if in both there is vcs compare, if only in one of them watch changelog or/and data
version1=($(echo $1 | tr '[:punct:]' ' ' | \
sed -e "s,\([a-zA-Z^ ]*\)\([0-9^ ]*\)\([a-zA-Z^ ]*\),\1 \2 \3,g"))
notify.debug "$FUNCNAME: version1 = ${version1[*]}"
version2=($(echo $2 | tr '[:punct:]' ' ' | \
sed -e "s,\([a-zA-Z^ ]*\)\([0-9^ ]*\)\([a-zA-Z^ ]*\),\1 \2 \3,g"))
notify.debug "$FUNCNAME: version2 = ${version2[*]}"
minfield=${#version1[*]}
maxfield=${#version2[*]}
echo ${version2[*]} ${version1[*]} | grep -i '[a-z]' &>/dev/null
if [ $? -eq 1 ]; then
if [[ ${#version2[*]} -lt ${#version1[*]} ]]; then
minfield=${#version2[*]}
maxfield=${#version1[*]}
fi
else
field1=$(echo ${version1[0]} | grep -i '[a-z]' &>/dev/null; echo $?)
field2=$(echo ${version2[0]} | grep -i '[a-z]' &>/dev/null; echo $?)
if [ $field1 -gt $field2 ]; then
retval=1
notify.debug "$FUNCNAME: retval = $retval"
return $retval
elif [ $field1 -lt $field2 ]; then
retval=2
notify.debug "$FUNCNAME: retval = $retval"
return $retval
fi
fi
for i in $(seq 0 1 $[$minfield-1]); do
echo ${version2[$i]} | grep -i '[a-z]' &>/dev/null
if [ $? -eq 0 ]; then
code2=${version2[$i]}
for t2 in ${!precedence[@]}; do
for arra2 in ${precedence[$t2]}; do
if [ "${version2[$i]}" = "$arra2" ]; then
version2[$i]=$[$t2+1]
break
else
for subarra2 in ${!arra2}; do
if [ "${version2[$i]}" = "$subarra2" ]; then
version2[$i]=$[$t2+1]
break
fi
done
fi
done
done
echo ${version2[$i]} | grep -i '[a-z]' &>/dev/null
[ $? -eq 0 ] && version2[$i]=$position
notify.debug "\
$FUNCNAME: \`$code2' has position ${version2[$i]} in precedence"
fi
echo ${version1[$i]} | grep -i '[a-z]' &>/dev/null
if [ $? -eq 0 ]; then
code1=${version1[$i]}
for t1 in ${!precedence[@]}; do
for arra1 in ${precedence[$t1]}; do
if [ "${version1[$i]}" = "$arra1" ]; then
version1[$i]=$[$t1+1]
break
else
for subarra1 in ${!arra1}; do
if [ "${version1[$i]}" = "$subarra1" ]; then
version1[$i]=$[$t1+1]
break
fi
done
fi
done
done
echo ${version1[$i]} | grep -i '[a-z]' &>/dev/null
[ $? -eq 0 ] && version1[$i]=$position
notify.debug "\
$FUNCNAME: \`$code1' has position ${version1[$i]} in precedence"
fi
if [[ ${version2[$i]} -gt ${version1[$i]} ]]; then
retval=2
break
elif [[ ${version2[$i]} -lt ${version1[$i]} ]]; then
retval=1
break
else
if [ $i -eq $(($minfield-1)) ]; then
for j in $(seq $i 1 $[$maxfield-1]); do
if [[ ${#version2[*]} -eq ${#version1[*]} ]]; then
retval=0
elif [[ ${version2[$j]} -ne 0 ]]; then
retval=2
elif [[ ${version1[$j]} -ne 0 ]]; then
retval=1
else
retval=0
fi
done
fi
fi
done
notify.debug "$FUNCNAME: retval = $retval"
return $retval
}
# function apse.scrapeversion()
# find for updates scanning the web
# args:
# -n|--pckname
# -s|--specname
# -w|--pckurl (optional)
# -p|--proxy (optional)
# -u|--proxy-user (optional)
# returns:
# 0 : package is already the latest version
# 1 : a newer version of the package is already installed
# 2 : a new version is available
# 3 : no information on latest available version
# sets up:
# APSE_LAST_VERSION : last available version
function apse.scrapeversion() {
local me="$FUNCNAME"
local retval
{ # (to make 'usage' a local function)
function usage() {
echo "\
$me, "$"version"" @version@""
Copyright (C) 2007 Stefano Cotta Ramusino <stefano.cotta@openmamba.org>""
"$"Find for updates scanning the web.""
"$"Usage"":
$me -n <name> -s <specname> [-w <url>] [-p <proxy> [-u <proxy_user>]]
"$"where the above options mean"":
-n, --pckname "$"Name of the package""
-s, --specname "$"Name of the spec file""
-w, --pckurl "$"URL of the project home page""
-v, --pckurlverbatim "$"URL with no variable expansion""
-p, --proxy "$"Proxy""
-u, --proxy-user "$"Proxy user""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
"$"Samples"":
$me -n autospec -s autospec
"$"Report bugs to <stefano.cotta@openmamba.org>."
}
}
local ARGS
ARGS=`LANG=C getopt -o han:s:w:p:u: \
--long help,allurl,pckname:,specname:,pckurl:,pckurlverbatim:,proxy:,proxy-user: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error"
eval set -- "$ARGS"
local src0pckname specname pckurl pckurlverbatim proxy proxy_user
while :; do
case "$1" in
-n|--pckname)
src0pckname="$2"; shift
notify.debug "$FUNCNAME: src0pckname = \"$src0pckname\""
;;
-s|--specname)
specname="$2"; shift
notify.debug "$FUNCNAME: specname = \"$specname\""
;;
-w|--pckurl)
pckurl="$2"; shift
notify.debug "$FUNCNAME: pckurl = \"$pckurl\""
;;
-v|--pckurlverbatim)
pckurlverbatim="$2"; shift
notify.debug "$FUNCNAME: pckurlverbatim = \"$pckurlverbatim\""
;;
-p|--proxy)
proxy="$2"; shift
notify.debug "$FUNCNAME: proxy = \"$proxy\""
;;
-u|--proxy-user)
proxy_user="$2"; shift
notify.debug "$FUNCNAME: proxy_user = \"***\""
;;
-h|--help)
usage
${EXIT_FUNC:-"exit"}
;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
esac
shift
done
[ "$src0pckname" ] || { usage; ${EXIT_FUNC:-"exit"} 1; }
# FIXME : should `specname' be an optional argument?
[ "$specname" ] || { usage; ${EXIT_FUNC:-"exit"} 1; }
local fcurlout=$(mktemp -q -t fcurlout.XXXXXXXX) ||
notify.error $"can't create temporary files"
# SPEC_SOURCE0_PCKNAME --> src0pckname
# SPEC_NAME --> specname
# ${SPEC_SOURCE[0]} --> pckurl
[ "$src0pckname" = "$specname" ] ||
{ src_name="$src0pckname"
notify.debug "src_name = \"$src_name\""; }
local curr_curl_url pck_file new_version last_version
local curr_curl_proxy_opts="\
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
# SOURCE0 url based search (only if 'pckurl' is a valid url)
if [[ "$pckurl" =~ .*://.* ]]; then
local pckurldir="`dirname $pckurl`/"
notify.debug "pckurldir = $pckurldir"
local pcknameverbatim=`basename $pckurlverbatim`
notify.debug "pcknameverbatim = $pcknameverbatim"
curr_curl_url="$pckurldir"
notify.note $"looking at"" <${NOTE}$curr_curl_url${NORM}> (\`${NOTE}source0${NORM}')..."
notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
curl $curl_opts_netlink $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
let "retval = $?"
case "$retval" in
0) ;;
6) notify.warning $"couldn't resolve host" ;;
7) notify.warning $"failed to connect to host" ;;
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
local svar svalue spck candidate_version
# filter "?var:" expressions
spck=`echo $pcknameverbatim | sed "s,%{?[A-Za-z0-9_]*:.*\(%[A-Za-z0-9_]*\)},\1,"`
while true; do
svar=`echo $spck | sed "\
s,.*%[{]*\([A-Za-z0-9_]*\)[}]*.*,\1,"`
[ "$svar" = "$spck" ] && break
if [ "$svar" = "version" ]; then
svalue="\\\([A-Za-z0-9._]*\\\)"
else
svalue=`rpmvars.solve "%$svar" "$spec_dir/$specname.spec"`
[ "$svalue" = "%$svar" ] && svalue=
fi
spck=`echo $spck | sed "\
s,%[{]*$svar[}]*,$svalue,"`
done
# remove archiver extension from rexexp to match changes
local pcknameregexp=$(echo [^A-Za-z0-9._-]$spck | sed "\
s,\.gz$,\\\.,
s,\.tgz$,\\\.,
s,\.bz2$,\\\.,
s,\.lzma$,\\\.,
s,\.lz$,\\\.,
s,\.tbz2$,\\\.,")
local retval=$?
notify.debug "pcknameregexp = $pcknameregexp"
if [ $retval -eq 0 ]; then
if [ "${pcknameregexp/(/}" = "${pcknameregexp}" ]; then
notify.warning "* "$"not parametric source0 name; cannot update"
else
candidate_versions=($(\
grep -i "$pcknameregexp" $fcurlout | \
sed "\
s,.*$pcknameregexp.*,\1,g
s,.*\.md5,,
s,\.zip$,,
s,\.tar\.gz$,,
s,\.tar\.bz2$,,
s,\.gz$,,
s,\.tgz$,,
s,\.bz2$,,
s,\.lzma$,,
s,\.i386$,,
s,\.bin$,,
s,\.exe$,,
s,\.dmg$,,
s,\.tbz2$,,
s,\.lz$,," |
sort -t. -n -r -k1 -k2 -k3 -k4 -k5 -k6 -k7 -k8 -k9 -k10 ))
local curr_version_dots new_version_dots candidate_version
curr_version_dots=`echo $SPEC_VERSION | tr -d [0-9][A-Z][a-z]_`
for candidate_version in ${candidate_versions[*]}; do
# skip version with no dots if current version has at least one
# (e.g. date release like 20000110)
new_version_dots=`echo $candidate_version | tr -d [0-9][A-Z][a-z]_`
[ "${#new_version_dots}" = 0 -a ${#curr_version_dots} -gt 0 ] &&
continue
new_version="$candidate_version"
break
done
fi
fi
if [ "$new_version" ]; then
notify.note "* "$"found version:"" \`${NOTE}$new_version${NORM}'"
last_version="$new_version"
fi
fi
# sourceforge.net, sf.net
local prj_name
if [ "$(echo $pckurl | grep "sourceforge.net\|sf.net")" ]; then
notify.note $"looking at"" <${NOTE}http://sourceforge.net${NORM}>..."
prj_name=$(echo "$pckurl" | sed -n 's,.*/\(.*\)/.*,\1,p')
[ "$prj_name" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"assertion failed:"" \"\$prj_name\" != \"\""
curr_curl_url="http://sourceforge.net/projects/$prj_name"
notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
let "retval = $?"
case "$retval" in
0) ;;
6) notify.warning $"couldn't resolve host" ;;
7) notify.warning $"failed to connect to host" ;;
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
[ "$retval" = "0" ] &&
if [ "$(sed -n "s,.*Invalid Project.*,error,pi" $fcurlout)" != \
"error" ]; then
[ "$src_name" ] || src_name="$specname"
pck_file=`grep -i -m1 "/download" $fcurlout | \
grep -i "$src_name" | \
sed -n "s,.*\"\([^\"]*\)\/download\".*,\1,pi"`
notify.debug "pck_file = \"$pck_file\""
[ "$src_name" ] && unset src_name
new_version=`echo $pck_file | sed -n "\
/[0-9]/!q # return nothing if no number is found in the package name
s,.*/,, # remove directory name, if any
s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
/-[0-9]*/{s/.*-\([0-9]*.*\)/\1/p;q} # <pck_name>-<pck_ver>
/_[0-9]*/{s/.*_\([0-9]*.*\)/\1/p;q} # <pck_name>_<pck_ver>
/[^-\.][0-9]\./{s/.*[^-\.]\([0-9]\..*\)/\1/p;q} # <pck_name><pck_ver>
# <pck_name> (no version, but <pck_name> can end with numbers)
/^[^0-9]*[0-9]*$/q"`
fi
fi
if [ "$new_version" ]; then
notify.note "* "$"found version:"" \`${NOTE}$new_version${NORM}'"
last_version="$new_version"
fi
# look at the other supported web sites...
# skip perl packages to prevent name confusion; these are checked above via Source0
if [ ! "$(echo $pckurl | grep "cpan.org")" ]; then
for i in ${!apse_site_name[@]}; do
notify.note \
$"looking at"" <${NOTE}${apse_site_name[$i]}${NORM}>..."
for search_name in $src_name $specname; do
[ "${apse_put_fields[$i]}" ] &&
curr_curl_url="${apse_uri[$i]}" ||
curr_curl_url="${apse_uri[$i]}${search_name}"
if [ "${apse_put_fields[$i]}" ]; then
notify.debug "\
curl \$curr_curl_proxy_opts -s -L -F ${apse_put_fields[$i]}${search_name} \"$curr_curl_url\""
curl $curr_curl_proxy_opts -s -L -F \
${apse_put_fields[$i]}${search_name} "$curr_curl_url" > $fcurlout
else
notify.debug "\
curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
fi
let "retval = $?"
case "$retval" in
0) ;;
6) notify.warning $"couldn't resolve host" ;;
7) notify.warning $"failed to connect to host" ;;
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
[ "$retval" = "0" ] || continue
if [ "$(cat $fcurlout | sed -n "\
s,.*${apse_error_msg[$i]}.*,error,pi")" != "error" ]; then
current_grep="$(echo "${apse_grep[$i]}" | sed -e "s,\${search_name},${search_name},g")"
current_sed="$(echo "${apse_sed[$i]}" | sed -e "s,\${search_name},${search_name},g")"
notify.debug "\
grep -i -m1 \"$current_grep\" \$fcurlout | sed -n \"$current_sed\""
new_version=$(grep -i -m1 "$current_grep" $fcurlout | sed -n "$current_sed")
if [ "$new_version" ]; then
notify.note "\
* "$"found version:"" \`${NOTE}$new_version${NORM}'"
if [ "$last_version" ]; then
notify.debug "apse.cmpversion \"$last_version\" \"$new_version\""
apse.cmpversion "$last_version" "$new_version"
[ $? -eq 2 ] && last_version="$new_version"
else
last_version="$new_version"
fi
fi
fi
done
done
fi
unset APSE_LAST_VERSION
if [ "$last_version" ]; then
APSE_LAST_VERSION="${last_version/-/.}"
notify.note $"\
last version of \`${NOTE}$specname${NORM}' found:"" \
\`${NOTE}${APSE_LAST_VERSION}${NORM}'"
apse.cmpversion "$SPEC_VERSION" "$APSE_LAST_VERSION"
retval=$?
if [ $retval -eq 0 ]; then
notify.note $"package \`${NOTE}$specname${NORM}' is already the latest version"
elif [ $retval -eq 2 ]; then
notify.note $"\
a new version of \`${NOTE}$specname${NORM}' is available!"
else
notify.warning $"a newer version of \`${NOTE}$specname${NORM}' is already installed"
fi
else
notify.warning $"cannot find a new version of \`$specname'"
retval=3
fi
rm -f $fcurlout
return $retval
}

120
lib/libcfg.lib.in Normal file
View File

@ -0,0 +1,120 @@
#!/bin/bash
# libcfg.lib -- @package@ library for loading the configuration file(s)
# Copyright (C) 2008,2011 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="libcfg"; export TEXTDOMAIN
# list of the configuration file(s)
default_cfg=(\
`ls /etc/@package@.conf ~/.@package@ ~/.@package@.d/*.conf 2>/dev/null`)
# check if the user configurations file for autospec is present
function config.check4user() {
local user_data=$(getent passwd 2>/dev/null | grep "x:$(id -u):")
local user_fullname=$(echo "$user_data" | cut -d: -f 5)
local email_infof_kde
if [ -r "$HOME/.kde/share/config/emaildefaults" ]; then
email_infof_kde="$HOME/.kde/share/config/emaildefaults"
elif [ -r "$HOME/.kde4/share/config/emaildefaults" ]; then
email_infof_kde="$HOME/.kde4/share/config/emaildefaults"
fi
if [[ -n "$email_infof_kde" && -z "$packager_email" ]]; then
packager_email="$(\
sed -n "/EmailAddress/{s/.*=//p}" "$email_infof_kde" 2>/dev/null)"
fi
[ -r ~/.@package@ ] || notify.error $"\
configuration file not found"": ${HOME:-~}/.@package@
---------------------------------------
${NOTE}"$"Hint"":${NORM}
packager_fullname=\"${user_fullname:-Your Name}\"
packager_email=\"${packager_email:-email@domain}\"
ftp_rw_user[1]=\"user\"
ftp_rw_passwd[1]=\"passwd\"
---------------------------------------
"
}
function config.security() {
if [ -n "$packager_group" ]; then
[ "$(groups 2>/dev/null | grep $packager_group 2>/dev/null)" ] ||
notify.error $"\
user \`$(id -nu)' does not belong to group \`$packager_group'"
# security check for configuration file(s) groups and permissions
for f in ${default_cfg[0]}; do
cfg_file_mod=(`find $f -printf "%g %m" 2>/dev/null`)
[[ ${cfg_file_mod[0]} = $packager_group &&
"`expr ${cfg_file_mod[1]} : '.*\(.\)'`" = 0 ]] ||
notify.warning $"\
the file \`$f' should be readable only by the group \`$packager_group'"
done
else
notify.warning "\`packager_group' "$"unset in the configuration files"
fi
}
# checking for errors in the configuration file
function config.integrity() {
mandatory_cfg_vars='
DISTRO
DISTRO_rpm
VENDOR
packager_fullname
packager_email
ftpurl_ro_rpms
ftpurl_ro_srpms
packager_group
allowed_libdirs
library_group
library_summary
library_group_devel
library_group_perl
format_buildroot_value
man_compress_ext
info_compress_ext
library_name_structure
perl_module_name_structure
patch_name_structure
source0_name_structure
plugindir
plugin_pck_update
plugin_spec_create
plugin_pck_extract
plugin_config_getvar'
# note: use indirect references to 'mandatory_cfg_vars' variables
for cfg_var in $mandatory_cfg_vars; do
(set -u; : ${!cfg_var}) 2>/dev/null ||
notify.error $"\
missing variable in the configuration file"" -- \`$cfg_var'"
done
}
cfg_files_num=0
for cfg_file in ${default_cfg[*]}; do
if [ -e "$cfg_file" ]; then
cfg_files_num=$(($cfg_files_num + 1))
notify.debug $"loading"": \`$cfg_file'..."
[ -r "$cfg_file" ] || notify.error $"cannot read"" \`$cfg_file'"
. "$cfg_file"
fi
done
[ "$cfg_files_num" = 0 ] && notify.error $"configuration file not found"
unset cfg_file

71
lib/libmsgmng.lib.in Normal file
View File

@ -0,0 +1,71 @@
#!/bin/bash
# libmsgmng.lib -- @package@ library to manage debug/warning/error messages
# Copyright (C) 2005,2006,2008 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="libmsgmng"; export TEXTDOMAIN
# function notify.enable_colors
# enable if possible the colorized output
# args:
# none
function notify.enable_colors() {
if [[ -t 1 && "$TERM" != raw && "$TERM" != dumb ]]; then
ESC=$(echo -en "\033") # ascii ESCape
CRIT="${ESC}[1;31m" # switch on red
NOTE="${ESC}[1;33m" # switch on yellow
WARN="${ESC}[1;31m"
EXIT="${ESC}[1;31m"
NORM=$(echo -en "${ESC}[m\017")
else
ESC= CRIT= NOTE= WARN= EXIT= NORM=
fi
}
# function notify.disable_colors
# disable the colorized output
# args:
# none
function notify.disable_colors() {
ESC= CRIT= NOTE= WARN= EXIT= NORM=
}
# notify family of message handling functions:
# - notify.warning
# - notify.error
# - notify.debug
# - notify.note
# args:
# $1 : message to print
# note:
# 1. debug messages are only printed if 'verbose' is great then '0'
# 2. error notifications are followed by a call to 'EXIT_FUNC'
# or 'exit' if this variable is unset
# (can set to 'return' for instance)
notify_def_msg="<"$"no message"">"
function notify.warning() {
echo -e "${WARN}WARNING${NORM}: ${1:-$notify_def_msg}" 1>&2
}
function notify.error() {
echo -e "${EXIT}ERROR${NORM}: ${EXIT}${1:-$notify_def_msg}${NORM}" 1>&2
${EXIT_FUNC:-"exit"} 1
}
function notify.debug() {
[ ${verbose:-0} -gt 1 ] || return
echo -e "${WARN}DEBUG${NORM}: ${1:-$notify_def_msg}" 1>&2
}
function notify.note() {
[ ${verbose:-0} -ge 0 ] || return
echo -e "${1:-$notify_def_msg}"
}

783
lib/libnetwork.lib.in Normal file
View File

@ -0,0 +1,783 @@
#!/bin/bash
# libnetwork.lib -- @package@ library to get info from internet repositories
# Copyright (C) 2008,2010 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 3 ] &&
{ echo $"this script requires bash version 3 or better" >&2 && exit 1; }
me=(${0##*/} "@version@" "@date@")
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="libnetwork"; export TEXTDOMAIN
# function repository.is_reachable()
# check if the server '$1' is reachable (test = DNS lookup query)
# args:
# $1 : server name
function repository.is_reachable() {
local ftpserver="${1/[a-z]*\:\/\//}"
[ "$ftpserver" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
host -W3 $ftpserver >&/dev/null
return $?
}
# function repository.get_pckname_from_HTML()
# ... ADDME ...
function repository.get_pckname_from_HTML() {
local pck_name="$1"
local infile="$2"
[ "$pck_name" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
[ "$infile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#2)"
notify.debug "$FUNCNAME: pck_name = \"$pck_name\""
case "$pck_name" in */*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"'\\' characters detected in \$pck_name" ;; esac
notify.debug "$FUNCNAME: infile = \"$infile\""
local pckname_from_HTML=( $(sed -n "\
# remove HTML tags --> get a better input
/<a href=\"/{s|.*<a href=\"\([^\"]*\)\".*|\1|;bm;};
/<A HREF=\"/{s|.*<A HREF=\"\([^\"]*\)\".*|\1|;bm;};
# exit loop if the line do not match the following regexpr
/^$pck_name-[^-]\+-[^-]\+$/bm;be;
:m;/^$pck_name-[^-]\+-[^-]\+$/p;:e" $infile) )
echo "$pckname_from_HTML"
}
# function repository.resolveURL()
# expand the given url according to the given arch
# args:
# $1 : url to expand
# $2 : current architecture
# return value:
# the expanded url
function repository.resolveURL() {
local ftpurl="$1" curr_arch="$2" resurl
[ "$ftpurl" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
[ "$curr_arch" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#2)"
case "$ftpurl" in
*@arch@*)
echo -n "$(echo $ftpurl | sed "s,@arch@,$curr_arch,g")" ;;
*) #echo -n "$ftpurl/$curr_arch/"
echo -n "$ftpurl/" ;;
esac
}
# function repository.get_SRPMS_name()
# get the full name of the first SRPMS package found using as
# package name '$@' and looking in the given list of repositories.
# The full names are saved in the vector 'got_SPEC_FILENAME[]'.
# The URL where the files have been found is saved in the variables
# 'got_SPEC_FILENAME_URL', and the index corresponding to this URL
# is saved in 'got_SPEC_FILENAME_URL_LEVEL' (eventually set via the
# '--urlnum' option)
# args:
# -r,--urllist : list of urls where to check for packages
# -n,--urlnum : the url number where to look at
# -p,--proxy : proxy server
# -u,--proxy-user : proxy user
# -l,--user : login user (for repositories that require authentication)
# $@ : list of package names to find for
# return value:
# 0 on success, 1 otherwise
function repository.get_SRPMS_name() {
local ARGS
ARGS=`LANG=C getopt \
-o n:r:p:u: \
--long urlnum:,urllist:,proxy:,proxy-user:,user: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
local i urlnum urllist proxy proxy_user user
eval set -- "$ARGS"
while :; do
case "$1" in
-n|--urlnum)
urlnum="$2"; shift
notify.debug "$FUNCNAME: urlnum = \"$urlnum\""
;;
-r|--urllist)
urllist=($2); shift
for i in `seq 1 1 ${#urllist[*]}`; do
notify.debug "$FUNCNAME: urllist[$(($i-1))] = ${urllist[$i-1]}"
done
;;
-p|--proxy)
proxy="$2"; shift
notify.debug "$FUNCNAME: proxy = \"$proxy\""
;;
-u|--proxy-user)
proxy_user="$2"; shift
notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
-l|--user)
user="$2"; shift
notify.debug "$FUNCNAME: user = \"$user\""
;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
esac
shift
done
if [ "$urlnum" ]; then
[[ "$urlnum" =~ ^[0-9]+$ ]] || notify.error $"\
(bug)"" -- $FUNCNAME: urlnum: "$"not a number"
fi
# this can be the result of a buggy configuration file
# [ "$urllist" ] || notify.error $"\
#(bug)"" -- $FUNCNAME: urllist: "$"unset"
local pck_names="$@"
notify.debug "$FUNCNAME: pck_names = \"${pck_names[@]}\""
[ "$pck_names" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
# FIXME: 'curl_opts_netlink' is an external variable
local curlopts="\
-L --silent --list-only $curl_opts_netlink\
${user:+ --user $user}\
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
local curlopts_debug="\
-L --silent --list-only $curl_opts_netlink\
${user:+ --user ***}\
${proxy:+ --proxy ***}${proxy_user:+ --proxy-user ***}"
local flist currflist currurl
local errors=0
let "i = 0"
for currurl in ${urllist[*]}; do
# get the list of files from the repository
notify.note $"\
getting list of files from"" \`${NOTE}$currurl/${NORM}'..."
case $currurl in
ftp://*|http://*) ;;
*) notify.warning $"unsupported query type for this protocol"
let "errors += 1"
continue ;;
esac
currflist="$(mktemp -q -t flist.XXXXXXXX)" ||
notify.error $"can't create temporary files"
notify.debug "$FUNCNAME: currflist = $currflist"
# NOTE: the trailing slash is necessary, do not remove it
notify.debug "$FUNCNAME: curl $curlopts_debug --url $currurl/ -o $currflist"
curl $curlopts --url $currurl/ -o $currflist
let "retval = $?"
notify.debug "$FUNCNAME: curl return code: $retval"
case "$retval" in
0) sed -i 's/\x0D$//' $currflist
flist[$i]="$currflist" ;;
6) notify.warning $"couldn't resolve host"
let "errors += 1" ;;
7) notify.warning $"failed to connect to host"
let "errors += 1" ;;
56) notify.warning $"failure in receiving network data"
let "errors += 1" ;;
*) notify.warning $"curl error (exit code: $retval)"
let "errors += 1" ;;
esac
[ -s "$currflist" ] || notify.warning $"cannot get the list of files"
let "i += 1"
done
[ "$errors" = "${#urllist[@]}" ] && return 1
local pck_name level
for pck_name in ${pck_names[@]}; do
let "level = ${urlnum:-0}"
let "i = 0"
for currurl in ${urllist[*]}; do
notify.debug "$FUNCNAME: pck_name = $pck_name"
if [ -s "${flist[$i]}" ]; then
got_SPEC_FILENAME=$(\
repository.get_pckname_from_HTML "$pck_name" "${flist[$i]}")
[ "$got_SPEC_FILENAME" ] &&
{ notify.debug "\
$FUNCNAME: got_SPEC_FILENAME = $got_SPEC_FILENAME"
got_SPEC_FILENAME_URL_LEVEL="$level"
got_SPEC_FILENAME_URL="$currurl"
break 2; }
fi
let "level += 1"
let "i += 1"
done
done
for i in ${!flist[@]}; do
notify.debug "$FUNCNAME: removing temporary file '${flist[$i]}'"
rm -f ${flist[$i]}
done
return 0
}
# function repository.get_RPMS_name()
# get the full name of the RPMS package '$1' looking at the
# repository '$1'.
# The full names are saved in the vector 'got_RPM_FILENAME[]'.
# args:
# $1 : URL where to check
# $2 .. $n : package names to look at
# -a,--archlist : list of supported architectures in the specified url
# -x,--exclude : exclude packages that match a given regexpr
# -c,--target-cpu : set the build architecture
# -p,--proxy : proxy server
# -u,--proxy-user : proxy user
# -l,--user : login user (for repositories that require authentication)
# return value:
# 0 on success, >0 otherwise
# example of output:
# got_RPM_FILENAME = (
# i586:mbrowse-0.3.1-1qilnx.i586.rpm
# i586:mbrowse-contrib-0.3.1-1qilnx.noarch.rpm
# ppc:mbrowse-contrib-0.3.1-1qilnx.noarch.rpm )
function repository.get_RPMS_name() {
ARGS=`LANG=C getopt \
-o a:x:c:p:u: \
--long archlist:,exclude:,target-cpu:,proxy:,proxy-user:,user: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
eval set -- "$ARGS"
local archlist excludeopt proxy proxy_user user target_cpu
while :; do
case $1 in
-a|--archlist)
archlist="$2"; shift
notify.debug "$FUNCNAME: archlist = \"$archlist\""
;;
-x|--exclude)
excludeopt="$2"; shift
notify.debug "$FUNCNAME: excludeopt = \"$excludeopt\""
;;
-c|--target-cpu)
target_cpu="$2"; shift
notify.debug "$FUNCNAME: target_cpu = \"$target_cpu\""
;;
-p|--proxy)
proxy="$2"; shift
notify.debug "$FUNCNAME: proxy = \"$proxy\""
;;
-u|--proxy-user)
proxy_user="$2"; shift
notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
-l|--user)
user="$2"; shift
notify.debug "$FUNCNAME: user = \"$user\""
;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error" ;;
esac
shift
done
local scanurl="$1"
[ "$scanurl" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
shift
local pck_names="$@"
notify.debug "$FUNCNAME: pck_names = \"${pck_names[@]}\""
[ "$pck_names" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#2)"
[ "$archlist" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"no list of architectures set"" (\$archlist)"
local flist=`mktemp -q -t flist.XXXXXXXX` ||
notify.error $"can't create temporary files"
local curr_arch errors pck_name curr_match
let "errors = 0"
local curr_arch_list
case "$target_cpu" in
"") curr_arch_list=( $archlist ) ;;
"noarch")
#curr_arch_list=( ${arch_noarch_upload[*]} )
# FIXME : if the noarch directory cannot be found a warning
# message is displayed
curr_arch_list=( $archlist noarch )
;;
*) # if the architecture is set by the user do ignore packages
# built for other architectures (aka: please do not remove
# packages built for other architectures!)
curr_arch_list="$target_cpu"
;;
esac
notify.debug "\
$FUNCNAME: curr_arch_list = ( ${curr_arch_list[*]} )"
# FIXME: 'curl_opts_netlink' is an external variable
local curlopts="\
-L --silent --list-only $curl_opts_netlink -o $flist\
${user:+ --user $user}\
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
local curlopts_debug="\
-L --silent --list-only $curl_opts_netlink -o $flist\
${user:+ --user ***}\
${proxy:+ --proxy ***}${proxy_user:+ --proxy-user ***}"
got_RPM_FILENAME=
for curr_arch in ${curr_arch_list[*]}; do
currurl="$(repository.resolveURL "$scanurl" "$curr_arch")"
#[ "$currurl" ] || notify.error $"(bug)"" -- $FUNCNAME: currurl = \"\""
# get the list of files from the repository
notify.note $"getting list of files from"" \`${NOTE}$currurl/${NORM}'..."
> $flist
# NOTE: the trailing slash is necessary, do not remote it
notify.debug "$FUNCNAME: curl $curlopts_debug --url $currurl/"
curl $curlopts --url $currurl/
let "retval = $?"
notify.debug "$FUNCNAME: curl return code: $retval"
case "$retval" in
0) ;;
6) notify.warning $"couldn't resolve host" ;;
7) notify.warning $"failed to connect to host" ;;
56) notify.warning $"failure in receiving network data" ;;
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
if [ -s "$flist" ]; then
sed -i 's/\x0D$//' $flist
case $currurl in
ftp://*|http://*)
for pck_name in ${pck_names[@]}; do
got_RPM_FILENAME=( ${got_RPM_FILENAME[@]} $(\
if [ -n "$excludeopt" ]; then
sed -n "\
/<a href=\"/{s|.*<a href=\"\([^\"]*\)\".*|\1|;bm;};
/<A HREF=\"/{s|.*<A HREF=\"\([^\"]*\)\".*|\1|;bm;};
/^$pck_name-[^-]*-[^-]*\.rpm/bm;be;
:m;/^$pck_name-[^-]*-[^-]*\.rpm/{s,.*,$curr_arch:&,p}
:e" $flist | grep -v -- "$excludeopt"
else
sed -n "\
/<a href=\"/{s|.*<a href=\"\([^\"]*\)\".*|\1|;bm;};
/<A HREF=\"/{s|.*<A HREF=\"\([^\"]*\)\".*|\1|;bm;};
/^$pck_name-[^-]*-[^-]*\.rpm/bm;be;
:m;/^$pck_name-[^-]*-[^-]*\.rpm/{s,.*,$curr_arch:&,p}
:e" $flist
fi ))
done
;;
*) notify.warning $"unsupported query type for this protocol" ;;
esac
else
notify.warning $"cannot get the list of files"" ($curr_arch)"
let "errors += 1"
fi
done
rm -f $flist
notify.debug "$FUNCNAME: got_RPM_FILENAME = ( ""$(
for pck_name in ${got_RPM_FILENAME[@]}; do
echo -en "\n $pck_name"
done ) )"
return $errors
}
# function curl.download
# download a file from an internet address using curl
#
# args:
# -d,--destdir : target directory
# -f,--force : force download (optional, default: false)
# -n,--filenum : number to display when executing this functions several times
# -o,--options : extra options to pass to curl
# -x,--exit-on-err : terminate the script if the download fails
# -p,--proxy : proxy
# -u,--proxy-user : proxy user
# --debug-unsecure : print private informations in debug mode
# $@ : list of files to be downloaded
# return value:
# 0 on success, 1 otherwise
function curl.download() {
local ARGS
ARGS=`LANG=C getopt \
-o d:fn:o:xp:u: \
--long destdir:,force,filenum:,options:,exit-on-err,proxy:,proxy-user: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
local destdir
local curl_opts
local exitonerror="0"
local force_download="0"
local proxy proxy_user
local filenum="1"
local is_a_localfile
eval set -- "$ARGS"
while :; do
case "$1" in
-d|--destdir)
destdir="$2"; shift
notify.debug "$FUNCNAME: destdir = \"$destdir\""
;;
-f|--force)
force_download=1
notify.debug "$FUNCNAME: force download is enabled"
;;
-n|--filenum)
filenum="$2"; shift
notify.debug "$FUNCNAME: filenum = \"$filenum\""
;;
-o|--options)
curl_opts="$2"; shift
notify.debug "$FUNCNAME: curl_opts = \"$curl_opts\""
;;
-x|--exit-on-err)
exitonerror="1"
notify.debug "$FUNCNAME: exitonerror = \"$exitonerror\""
;;
-p|--proxy)
proxy="$2"; shift
notify.debug "$FUNCNAME: proxy = \"$proxy\""
;;
-u|--proxy-user)
proxy_user="$2"; shift
notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
--) shift; break;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
esac
shift
done
# FIXME: add support for list of files
local file_url="$1"
notify.debug "$FUNCNAME: file_url = \"$file_url\""
[ "$file_url" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
[ "$destdir" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--destdir)"
local file_name
case "$file_url" in
http://*|https://*|ftp://*)
file_name="${file_url##*/}"
is_a_localfile="0" ;;
*://*)
notify.error $"unsupported protocol"": \`${file_url//\:*}'"
;;
*) #notify.error $"not an internet address"": \`$file_url'"
# it's a local file
[ -e "$destdir/$file_url" ] ||
notify.error $"file not found"": \`$destdir/$file_url'"
notify.note "[${filenum:-*}] $NOTE$file_url$NORM ... "$"skipped"
return 0
;;
esac
if [ -e $destdir/$file_name ]; then
if [ "$force_download" = "0" ]; then
notify.note "[${filenum:-*}] $NOTE$file_url$NORM ... "$"skipped"
return 0
else
rm -f $destdir/$file_name
fi
fi
notify.note $"downloading"" ${NOTE}$file_name${NORM} ..."
[ "$(type -p curl)" ] || notify.error $"utility not found"": \`curl'"
[ -d "$destdir" ] ||
if [ "$exitonerror" = 1 ]; then
notify.warning $"\
(bug)"" -- $FUNCNAME: "$"no such directory"": \`$destdir'"
return 1
else
notify.error $"\
(bug)"" -- $FUNCNAME: "$"no such directory"": \`$destdir'"
fi
notify.note "\
[${filenum:-*}] $NOTE$file_url$NORM
--> $destdir/$file_name"
pushd $destdir >/dev/null
local retval
notify.debug "curl $curl_options\
${proxy:+ --proxy $proxy}${proxyuser:+ --proxy-user $proxy_user} $file_url"
curl $curl_options \
${proxy:+ --proxy $proxy} ${proxyuser:+ --proxy-user $proxy_user} \
"$file_url"
retval=$?
notify.debug "$FUNCNAME: curl return code: $retval"
case "$retval" in
0) ;;
6) notify.warning $"couldn't resolve host" ;;
7) notify.warning $"failed to connect to host" ;;
56) notify.warning $"failure in receiving network data" ;;
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
[ -e $destdir/$file_name ] ||
if [ "$exitonerror" = 1 ]; then
notify.error $"cannot download"": \`$file_name'"
else
popd >/dev/null
notify.warning $"cannot download"": \`$file_name'"
return 1
fi
popd >/dev/null
}
# function curl.upload
# upload a file using curl
#
function curl.upload() {
local ARGS
ARGS=`LANG=C getopt \
-o f:l:o:p:u:x \
--long upload-file:,user:,options:,proxy:,proxy-user:,\
repository-alias:,exit-on-err,debug-unsecure \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
local upfile user options proxy proxy_user
local exitonerror=0
local debug_unsecure=0
eval set -- "$ARGS"
while :; do
case "$1" in
-f|--upload-file)
upfile="$2"; shift
;;
-l|--user)
user="$2"; shift
#notify.debug "$FUNCNAME: user = \"$user\""
;;
-o|--options)
options="$2"; shift
#notify.debug "$FUNCNAME: options = \"$options\""
;;
-p|--proxy)
proxy="$2"; shift
#notify.debug "$FUNCNAME: proxy = \"$proxy\""
;;
-u|--proxy-user)
proxy_user="$2"; shift
#notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
-x|--exit-on-err)
exitonerror="1"
#notify.debug "$FUNCNAME: exitonerror = \"$exitonerror\""
;;
--debug-unsecure)
debug_unsecure="1"
;;
--) shift; break;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
esac
shift
done
#notify.debug "$FUNCNAME: debug_unsecure = \"$debug_unsecure\""
local destfile="$1"
[ "$destfile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
[ -e "$upfile" ] || notify.error $"package not found"": \`$upfile'"
# add an extra newline to workaroung a bug in curl
notify.note "
* ${NOTE}$upfile${NORM}
--> $destfile"
# option: --write-out [%{url_effective}]\\n
# the option '--progress-bar' is currently buggy in curl
local curr_curl_cmd="$options --progress-bar --fail -o /dev/null \
${proxy:+ --proxy $proxy}${proxyuser:+ --proxy-user $proxy_user} \
--upload-file $upfile $destfile"
if [ "$debug_unsecure" = "1" ]; then
notify.debug "curl --user $user $curr_curl_cmd"
else
notify.debug "curl --user ***:*** $curr_curl_cmd"
fi
curl --user $user $curr_curl_cmd
[ $? -eq 0 ] || { [ "$exitonerror" = 1 ] && exit 1 || return 1; }
}
# function curl.ftp_command
# execute an ftp command (creating a directory, renamig a file,
# deleting) using curl
#
function curl.ftp_command() {
local ARGS
ARGS=`LANG=C getopt \
-o l:o:p:u:a: \
--long user:,options:,proxy:,proxy-user:,debug-unsecure,\
action:,directory:,rename-from:,rename-to:,delete:,ftp-passive \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
local user options proxy proxy_user ftp_passive
local action directory fromfile tofile deletefile
local exitonerror=0
eval set -- "$ARGS"
while :; do
case "$1" in
-l|--user)
user="$2"; shift
#notify.debug "$FUNCNAME: user = \"$user\""
;;
-o|--options)
options="$2"; shift
#notify.debug "$FUNCNAME: options = \"$options\""
;;
-p|--proxy)
proxy="$2"; shift
#notify.debug "$FUNCNAME: proxy = \"$proxy\""
;;
-u|--proxy-user)
proxy_user="$2"; shift
#notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
--debug-unsecure)
debug_unsecure="1"
;;
-a|--action)
action="$2"; shift
;;
--directory)
directory="$2"; shift
;;
--rename-from)
fromfile="$2"; shift
;;
--rename-to)
tofile="$2"; shift
;;
--delete)
deletefile="$2"; shift
;;
--ftp-passive)
ftp_passive="--ftp-pasv"
;;
-x|--exit-on-err)
exitonerror="1"
;;
--) shift; break;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
esac
shift
done
local backup_ftp_server="$1"
[ "$backup_ftp_server" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
[ "$ftp_passive" ] && options="$options $ftp_passive"
# NOTE: see RFC959 for the sintax of the 'quote' commands
# curl --ftp-pasv --user user:password \
# -Q "MKD /devel/old/prova.dir" \
# -Q "RNFR /devel/old/prova.tmp" \
# -Q "RNTO /devel/old/prova.dir/prova.tmp" ftp.linuxdistro.org
case "$action" in
mkdir)
[ "$directory" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--directory)"
notify.debug "\
curl $options --user \"***:***\" --quote \"MKD $directory\" $1"
curl $options --user "$user" --quote "MKD $directory" $1 &>/dev/null
;;
rename-file)
[ "$fromfile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--rename-from)"
[ "$tofile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--rename-to)"
notify.debug "curl $options --user \"***:***\"\
--quote \"RNFR $fromfile\" --quote \"RNTO $tofile\" $1"
curl $options --user "$user" \
--quote "RNFR $fromfile" --quote "RNTO $tofile" $1 &>/dev/null
;;
delete)
[ "$deletefile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--delete)"
# example:
# curl -v --ftp-pasv --user "$user" \
# --quote "CWD SRPMS.base" \
# --quote "DELE filename-0.0.1-1distro.src.rpm" \
# ftp://ftpaccounts.openmamba.org
# -or-
# curl -v --ftp-pasv --user "$user" \
# --quote "DELE SRPMS.base/filename-0.0.1-1distro.src.rpm" \
# ftp://ftpaccounts.openmamba.org
notify.debug "\
curl $options --user \"***:***\" --quote \"DELE $deletefile\" $1"
curl $options --user "$user" --quote "DELE $deletefile" $1 &>/dev/null
;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"unknown action"": ($action)"
esac
retval=$?
case "$retval" in
0) ;;
6) notify.warning $"couldn't resolve host" ;;
7) notify.warning $"failed to connect to host" ;;
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
[[ "$retval" != "0" && "$exitonerror" = 1 ]] && exit 1
}

1216
lib/libspec.lib.in Normal file

File diff suppressed because it is too large Load Diff

40
man/it/Makefile Normal file
View File

@ -0,0 +1,40 @@
# Makefile for autospec
# Copyright (C) 2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ../..
include $(srcdir)/Makefile.env
LANG=it
pck_manpages := autospec.1
all:
install: $(pck_manpages)
$(INSTALL_DIR) $(DESTDIR)$(mandir)/$(LANG)/man1;\
for f in $(pck_manpages); do\
$(INSTALL_DATA) $${f} $(DESTDIR)$(mandir)/$(LANG)/man1/$${f};\
done
uninstall:
@for f in $(pck_manpages); do\
echo "rm -f $(DESTDIR)$(mandir)/$(LANG)/man1/$${f}";\
rm -f $(DESTDIR)$(mandir)/$(LANG)/man1/$${f};\
done
clean:
rm -f $(pck_manpages)

316
man/it/autospec.1.in Normal file
View File

@ -0,0 +1,316 @@
.TH AUTOSPEC "9" "@date_my@" "@package@ @version@" "User Commands"
.SH NOME
\fB@package@\fR - script di frontend per la creazione e l'aggiornamento e la verifica di pacchetti rpm.
.br
\fBconfig-getvar\fR - plugin per la visualizzazione di variabili presenti nei file di configurazione di autospec.
.br
\fBpck-extract\fR - plugin per l'estrazione di file da archivi srpm.
.br
\fBpck-update\fR - plugin per l'aggiornamento di archivi rpm.
.br
\fBspec-create\fR - plugin per la creazione di archivi rpm.
.br
\fB@pck_lib@\fR - libreria di funzioni per l'analisi degli specfile.
.SH VERSIONE
Questo documento e' aggiornato alla versione 1.8.0 di @package@.
.SH DESCRIZIONE
@package@ e' una suite di script che permette di velocizzare ed automatizzare una parte
delle operazioni necessarie alla creazione, al mantenimento (aggiornamento) dei pacchetti
rpm di una intera distribuzione ed al controllo di comuni errori e vulnerabilita'.
.br
@package@ e' modulare ed altamente configurabile e quindi facilmente adattabile alle
particolarita' specifiche di ogni distribuzione basata su pacchetti rpm.
.br
@package@ fornisce inoltre la libreria @pck_lib@, utilizzabile anche da script di shell
esterni per ricavare in modo semplice informazioni su un qualsiasi specfile dato in input.
.SH FILE DI CONFIGURAZIONE
@package@ legge all'avvio in primo luogo il file globale \fI@sysconfdir@/@pck_conf@\fR
e quindi i file privati dell'utente: \fI~/.@package@\fR e/o \fI~/.@package@.d/*.conf\fR.
E' buona norma non modificare direttamente il file globale.
Utilizzare i file privati per tale scopo.
.SH SINTASSI
@package@ e' lo script principale ed ha funzione di frontend per una serie di script e
librerie specializzate.
Per questo motivo sono possibili differenti modalita' distinte di utilizzo.
Si ricorda che le opzioni indicate tra parentesi quadre sono opzionali.
.SS "Creazione di specfile"
\fB@package@\fR \
\fB\-s\fR \fItarball\fR \
[\fB\-n\fR \fIname\fR] \
[\fB\-v\fR \fIver\fR] \
[\fB\-t\fR \fItype\fR] \
[\fB\-o\fR \fIoutfile\fR]
.TP
\fB\-s\fR, \fB\-\-source\fR
cerca di creare uno specfile per il \fItarball\fR indicato
.TP
\fB\-n\fR, \fB\-\-pck\-name\fR
nome del pacchetto (default: ricavato dal nome del tarball)
.TP
\fB\-v\fR, \fB\-\-pck\-version\fR
versione del pacchetto (default: ricavato dal nome del tarball)
.TP
\fB\-t\fR, \fB\-\-type\fR
categoria dello specfile da generare:
.br
\fIstandard\fR : specfile standard (default)
.br
\fIgnome\fR : specfile per pacchetti gnome
.br
\fIkde3\fR : specfile per pacchetti kde3
.br
\fIkde4\fR : specfile per pacchetti kde4
.br
\fIlibrary\fR : specfile per librerie
.br
\fIlibrarytools\fR : specfile per librerie con tool
.br
\fIperl\fR : specfile per singoli moduli perl
.br
\fIpython\fR : specfile per moduli python
.br
\fIstandard-daemon\fR : specfile per servizi di sistema/rete
.TP
\fB\-o\fR, \fB\-\-output\fR
redirige lo standard output sul file \fIoutfile\fR
.SS "Aggiornamento di pacchetti rpm"
\fB@package@\fR \
\fB\-u\fR \fIpck\fR \fB\-a\fR \fIlst\fR [\fIver\fR] [\fIrel\fR] \
[\fB\-d\fR \fIv1=r1\fR[,\fIv2=r2\fR,...]] \
[\fB\-\-server\-download\fR \fIint\fR] \
[\fB\-\-server\-upload\fR \fIint\fR] \
[\fB\-l\fR \fIusr\fR:\fIpswd\fR] \
[\fB\-S\fR \fIspecfile\fR] \
[\fB\-A\fR \fIarch\fR] \
[\fB\-\-changelog\fR "\fImsg\fR" ] \
[\fB\-\-nosrpm\fR|\fB\-\-norpm\fR] \
[\fB\-\-force-update\fR] [\fB\-\-force-build\fR] [\fB\-\-force-install\fR] \
[\fB\-\-ignore-test \fIt1\fR[,\fIt2\fR,...]\fR] \
[\fB\-c\fR] [\fB\-f\fR] [\fB\-L\fR] [\fB\-R\fR]
.TP
\fB\-u\fR, \fB\-\-update\fR
aggiorna automaticamente il pacchetto \fIpck\fR, versione \fIver\fR,
release \fIrel\fR
.TP
\fB\-a\fR, \fB\-\-action\fR
Esegue la lista di azioni separate da virgole \fIlst\fR
.br
\fI0\fR. indica le versioni del pacchetto disponibili nei repository
.br
\fI1\fR. download ed installazione del pacchetto srpm
.br
\fI2\fR. controlla se e' disponibile un aggiornamento
.br
\fI3\fR. download dei nuovi file sorgente
.br
\fI4\fR. aggiornamento e controllo dello specfile
.br
\fI5\fR. creazione dei pacchetti rpm e srpm
.br
\fI6\fR. creazione della lista dei build requirement
.br
\fI7\fR. simulazione dell'installazione dei pacchetti rpm
.br
\fI8\fR. esecuzione dei test di qualita' e sicurezza
.br
\fI9\fR. calcolo dei valori di hashing md5 e sha1
.br
\fI10\fR. upload dei nuovi pacchetti sul sito ftp,
rimozione dei vecchi pacchetti dal sito ftp
(backup in `$ftp_rw_old_dir', se la variabile e' definita)
.br
\fI11\fR. installazione dei nuovi pacchetti rpm
.TP
\fB\-\-force-update\fR
forza l'aggiornamento dei pacchetti rpm e srpm
.TP
\fB\-\-force-build\fR
ricrea comunque i pacchetti rpm e srpm
.TP
\fB\-\-force-install\fR
installa i nuovi pacchetti anche in caso di errori rpm
.TP
\fB\-\-force\-download
scarica i file sorgente anche se presenti in SOURCE
.TP
\fB\-\-force\fR
cerca di eseguire comunque le azioni specificate
.TP
\fB\-\-ignore-test
non esegue i test indicati (\fIt1\fR, \fIt2\fR,...)
.TP
\fB\-d\fR, \fB\-\-define\fR
assegna alle variabili \fIv1\fR, \fIv2\fR,... i valori \fIr1\fR, \fIr2\fR,...
.TP
\fB\-\-server\-download\fR
server da utilizzare nel download dei pacchetti
.TP
\fB\-\-server-upload\fR
server dove effettuare l'upload dei pacchetti
.TP
\fB\-\-server\fR
server per l'upload e il download dei pacchetti
.TP
\fB\-l\fR, \fB\-\-login\fR
user \fIusr\fR e password \fIpswd\fR per effettuare l'upload sul sito FTP
.TP
\fB\-S\fR, \fB\-\-specfile\fR
nome dello specfile (default: \fIname\fR.spec)
.TP
\fB\-A\fR, \fB\-\-arch\fR
forza un valore per l'architettura
.TP
\fB\-\-changelog\fR
scrive il messaggio \fImsg\fR nel changelog del pacchetto
(utilizzare `\en' come terminatore di linea in caso di messaggi multilinea)
.TP
\fB\-\-nosrpm\fR
crea soltanto i pacchetti rpm (azione 5)
.br
non effettua l'upload del pacchetto srpm (azione 10)
.TP
\fB\-\-norpm\fR
crea soltanto il pacchetto srpm (azione 5)
.br
non effettua l'upload dei pacchetti rpm (azione 10)
.TP
\fB\-c\fR, \fB\-\-clear\fR
rimuove tutti i file temporanei
.TP
\fB\-f\fR, \fB\-\-format\fR
abilita la riformattazione dello specfile
.TP
\fB\-L\fR, \fB\-\-log\fR
abilita il log su file (nella directory: `$logging_dir')
.TP
\fB\-R\fR, \fB\-\-rebuild\fR
attiva modalita' ed impostazioni di rebuild (azione 4)
.TP
\fB\-R\fR, \fB\-\-root\fR
definisce una root directory alternativa per rpm
.SS "Estrazione di file da pacchetti srpm"
\fB@package@\fR \
\fB\-x\fR \fB\-F\fR \fIfile(s)\fR [\fB\-\-destdir\fR=\fIdir\fR] \fIsrpm_pck\fR
.TP
\fB\-x\fR, \fB\-\-extract\fR
estrae dal pacchetto srpm \fIsrpm_pck\fR...
.TP
\fB\-F\fR, \fB\-\-files\fR
\&...il file o la lista di file \fIfile(s)\fR
.TP
\fB\-\-destdir\fR
salva i file estratti nella cartella \fIdir\fR
.SS "Richiesta del valore di variabili presenti nei file di configurazione"
\fB@package@\fR \
[\fB\-C\fR \fIconf_file\fR] \fB\-\-eval\fR=\fIvar\fR
.TP
\fB\-C\fR, \fB\-\-config\fR
utilizza un file di configurazione alternativo \fIconf_file\fR
.br
file di default: \fI@sysconfdir@/@pck_conf@\fR, \fI~/.@package@\fR
.TP
\fB\-\-eval\fR
stampa il valore che \fIvar\fR assume nei file di configurazione
.SS "Modalita' operative"
Sono inoltre disponibili alcune opzioni standard ed alcune opzioni di uso generale
che influenzano il tipo di output generato.
.TP
\fB\-h\fR, \fB\-\-help\fR
stampa una schermata di aiuto e termina il programma
.TP
\fB\-V\fR, \fB\-\-version\fR
stampa il numero di versione e termina il programma
.TP
\fB\-q\fR, \fB\-\-quiet\fR
non stampa alcun dettaglio delle operazioni in esecuzione
.TP
\fB\-r\fR, \fB\-\-colorize\fR
abilita l'output colorato
.TP
\fB\-D\fR, \fB\-\-debug\fR
attiva la modalita' di debugging (output prolisso)
.SH "ESEMPI"
.B
@package@
\fB\-s\fR ~/software/@package@\-@version@.tar.bz2 \fB\-t\fR standard \fB\-o\fR @package@.spec
.br
.B
@package@
\fB\-s\fR ftp://ftp.gnu.org/pub/gnu/bash/bash-3.2.tar.gz
.br
.B
@package@
\fB\-u\fR @package@ @version@ \fB\-a\fR4 \fB\-f\fR \fB\-\-changelog\fR "changelog entry"
.br
.B
@package@
\fB\-\-log\fR \fB\-u\fR @package@ \fB\-a\fR5,7:9 \fB\-\-define\fR addons_ver=0.9
.br
.B
@package@
\fB\-c\fR \fB\-u\fR \fB\-l\fR usr:pswd @package@ @version@ \fB\-a\fR10 \fB--server-upload\fR=0
.br
.B
@package@
\fB\-u\fR @package@ \fB\-a\fR1,4,5 \fB\-\-arch\fR=noarch \fB\-\-rebuild\fR \fB\-\-ignore-test\fR 6,7
.br
.B
@package@
\fB\-u\fR @package@ \fB\-a\fR10 \fB\-\-norpm\fR \fB\-S\fR /var/tmp/specs/@package@.spec
.br
.B
@package@
\fB\-u\fR @package@ \fB\-a\fR11 \fB\-\-force\fR
.br
.B
@package@
\fB\-x\fR @package@\-@version@\-1mamba.src.rpm \fB\-F\fR \e*.spec \fB\-\-destdir=\fR/tmp/specs
.br
.B
@package@
\fB\-q\fR \fB\-C\fR @sysconfdir@/@package@.conf \fB\-\-eval=\fR"logging_dir"
.SH AUTORI
Davide Madrisan <davide.madrisan@gmail.com>
.br
Creatore e sviluppatore principale di @package@ (frontend, plugin, libspec.lib, documentazione).
Stefano Cotta Ramusino (whitone) <stefano.cotta@openmamba.org>
.br
Patch varie. Controllo delle licenze indicati negli specfile.
Modulo \fIAPSE\fR (Autospec Package Search Engine).
Modularizzare dei file di configurazione personali di @package@.
Silvan Calarco <silvan.calarco@mambasoft.it>
.br
Diverse patch, attivita' diffusa di beta testing.
Codice per la generazione automatica della lista dei build requirements.
Mofiche per permettere l'utilizzo di autospec in multi-architettura.
.SH VEDERE ANCHE
file:///usr/share/doc/@package@-@version@/@package@-it-HOWTO
.SH "BACHI"
Inviare patch, segnalazioni di bachi, richieste di funzionalita' a <davide.madrisan@gmail.com>.
.br
Nel caso di bachi riscontrati, effettuarne una descrizione accurata e possibilmente un modo per riprodurli.
.SH COPYRIGHT
Copyright (C) 2004\-2011 Davide Madrisan <davide.madrisan@gmail.com>
.br
.br
Questo e' software libero. E' possibile redistribuirlo e/o modificarlo nei termini
della GNU General Public License versione 2 cosi' come pubblicata dalla
Free Software Foundation.
Non e' fornita ALCUNA garanzia, neppure di NEGOZIABILITA' o di APPLICABILITA'
PER UN PARTICOLARE SCOPO.

3
patches/.directory Normal file
View File

@ -0,0 +1,3 @@
[Dolphin]
Timestamp=2010,5,12,21,50,33
ViewMode=1

View File

@ -0,0 +1,21 @@
diff -Nru autospec-1.7.3.orig//plugins/pck-update.in autospec-1.7.3/plugins/pck-update.in
--- autospec-1.7.3.orig//plugins/pck-update.in 2011-01-09 18:13:09.000000000 +0100
+++ autospec-1.7.3/plugins/pck-update.in 2011-03-23 19:54:56.180218040 +0100
@@ -2366,13 +2366,13 @@
if [ ! -e $solibpath -a "${solibpath:0:5}" = "/lib/" ]; then
solibpath="/usr$solibpath"
fi
- buildreq=`rpm -qf $solibpath 2>/dev/null | sed "s|\(.*\)-[^-]*-[^-]*|\1|"`
- if [ ! "$buildreq" ]; then
+ eval buildreq=`rpm -qf $solibpath 2>/dev/null | sed "s|\(.*\)-[^-]*-[^-]*|\1|"` 2>/dev/null
+ if [ ! "$buildreq" -o $? -ne 0 ]; then
# let's try removing version extension in libname
# (eg. liblber-2.2.so => liblber.so)
solibpath=`echo $solibpath | sed "s|-[0-9.]*\.so|.so|"`
- buildreq=`rpm -qf $solibpath 2>/dev/null | sed "s|\(.*\)-[^-]*-[^-]*|\1|"`
- [ ! "$buildreq" ] && echo "#$req: .so link not found" >> $frequires
+ eval buildreq=`rpm -qf $solibpath 2>/dev/null | sed "s|\(.*\)-[^-]*-[^-]*|\1|"` 2>/dev/null
+ [ ! "$buildreq" -o $? -ne 0 ] && echo "#$req: .so link not found" >> $frequires
fi
else
echo "\

View File

@ -0,0 +1,11 @@
--- /usr/share/autospec/plugins/pck-update.orig 2008-10-02 10:20:52.000000000 +0200
+++ /usr/share/autospec/plugins/pck-update 2008-09-26 18:19:05.000000000 +0200
@@ -368,7 +368,7 @@
notify.note " * "$"running test"" $arg (%find_lang)..."
# FIXME : the test should perhaps be improved...
- grep -q "^[ ]*[^# ]*/locale/" $specfile || continue
+ grep -q "^[ ]*[^# ]*/share/locale/" $specfile || continue
notify.error $"\
"$"localization files must be packaged via \`%find_lang'""${NORM}

View File

@ -0,0 +1,50 @@
--- pck-update 2010-03-07 17:26:00.653388973 +0100
+++ /usr/bin/pck-update 2010-03-07 17:25:45.000000000 +0100
@@ -2117,12 +2117,12 @@
done
local rpmbuild_opts="\
- --define \"%_srcrpmdir $srpms_dir\" \
- --define \"%_rpmdir $rpms_dir\" \
- --define \"%_specdir $spec_dir\" \
- --define \"%_sourcedir $source_dir\" \
- --define \"%_builddir $build_dir\" \
- --define \"%_tmppath $tmppath_dir\""
+ --define=\"%_srcrpmdir $srpms_dir\" \
+ --define=\"%_rpmdir $rpms_dir\" \
+ --define=\"%_specdir $spec_dir\" \
+ --define=\"%_sourcedir $source_dir\" \
+ --define=\"%_builddir $build_dir\" \
+ --define=\"%_tmppath $tmppath_dir\""
# check if we are cross-compiling
[ "$BUILD_ARCH" != "$target_cpu" ] &&
@@ -2130,20 +2130,21 @@
[ "$cleanup" = "1" ] && rpmbuild_opts="$rpmbuild_opts --clean"
+ local rpmdefine_opts="\
+$(for i in `seq 1 1 ${#define_list_name[*]}`; do
+echo -n " --define=\"${define_list_name[$i-1]} ${define_list_value[$i-1]}\""
+done)"
+ notify.debug "rpmdefine_opts = \"$rpmdefine_opts\""
+
# note: exit with error when build requirements are missing
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
- rpmbuild --nobuild --define "%_sourcedir $source_dir" \
- $spec_dir/$SRPM_SPECFILE 2>&1 ||
+ eval "\
+rpmbuild --nobuild $rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"
notify.debug "define_list_value = (${define_list_value[*]})"
- local rpmdefine_opts="\
-$(for i in `seq 1 1 ${#define_list_name[*]}`; do
-echo -n " --define=\"${define_list_name[$i-1]} ${define_list_value[$i-1]}\""
-done)"
- notify.debug "rpmdefine_opts = \"$rpmdefine_opts\""
if [ "$norpms" = 1 ]; then
notify.note "\

View File

@ -0,0 +1,79 @@
--- plugins/pck-update.in 2010-03-12 19:52:44.000000000 +0100
+++ /usr/bin/pck-update 2010-03-22 00:56:15.000000000 +0100
@@ -142,6 +142,7 @@
-f, --format "$"Enable specfile autoformatting""
-L, --log "$"Unable logging to file (logging dir: \`\$logging_dir')""
-R, --rebuild "$"Enable rebuilding mode and settings (action 4 only)""
+ --root "$"Specify an alternative root directory to rpm""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
@@ -191,7 +192,7 @@
force-update,force-build,force-install,force,\
ignore-test:,clear,format,log,rebuild,\
debug,quiet,colorize,help,version,\
-frontend_opts: \
+frontend_opts:,root: \
-n "$me" -- "$@"`
[ $? = 0 ] || exit 1
@@ -263,6 +264,8 @@
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
+ --root)
+ rpm_root_opts="-r $2"; shift ;;
-h|--help)
usage 0 ;;
-V|--version)
@@ -2122,11 +2125,12 @@
--define=\"%_specdir $spec_dir\" \
--define=\"%_sourcedir $source_dir\" \
--define=\"%_builddir $build_dir\" \
- --define=\"%_tmppath $tmppath_dir\""
+ --define=\"%_tmppath $tmppath_dir\" \
+ $rpm_root_opts"
# check if we are cross-compiling
[ "$BUILD_ARCH" != "$target_cpu" ] &&
- rpmbuild_opts="--target $target_cpu"
+ rpmbuild_opts="$rpmbuild_opts --target $target_cpu"
[ "$cleanup" = "1" ] && rpmbuild_opts="$rpmbuild_opts --clean"
@@ -2140,7 +2144,6 @@
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
eval "rpmbuild --nobuild \
$rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
- $spec_dir/$SRPM_SPECFILE 2>&1 ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"
@@ -2140,7 +2144,6 @@
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
eval "rpmbuild --nobuild \
$rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
- $spec_dir/$SRPM_SPECFILE 2>&1 ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"
@@ -2362,7 +2365,7 @@
notify.error $"package not found"": \`$filename'"
done
- rpm -U --test \
+ rpm -U --test $rpm_root_opts \
$(for pck in ${SPEC_TARGET[*]}; do
echo -n "$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm "
@@ -3083,8 +3086,8 @@
else
[ "$rpm_install" ] || notify.error "\
\`rpm_install': "$"unset in the configuration files"
- notify.debug "$rpm_install $pck2install_list"
- $rpm_install $pck2install_list ||
+ notify.debug "$rpm_install $pck2install_list $rpm_root_opts"
+ $rpm_install $pck2install_list $rpm_root_opts ||
notify.error $"cannot install the new rpm packages"
fi
fi

View File

@ -0,0 +1,59 @@
--- autospec-1.4.15/lib/libapse.lib.in.orig 2010-01-12 22:46:27.000000000 +0100
+++ autospec-1.4.15/lib/libapse.lib.in 2010-03-26 13:28:14.000000000 +0100
@@ -397,6 +397,56 @@
fi
fi
+ # sourceforge.net, sf.net
+
+ local prj_name
+
+ if [ "$(echo $pckurl | grep "sourceforge.net\|sf.net")" ]; then
+ notify.note $"looking at"" <${NOTE}http://sourceforge.net${NORM}>..."
+
+ prj_name=$(echo "$pckurl" | sed -n 's,.*/\(.*\)/.*,\1,p')
+ [ "$prj_name" ] || notify.error $"\
+(bug)"" -- $FUNCNAME: "$"assertion failed:"" \"\$prj_name\" != \"\""
+
+ curr_curl_url="http://sourceforge.net/projects/$prj_name"
+ notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
+ curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
+
+ let "retval = $?"
+ case "$retval" in
+ 0) ;;
+ 7) notify.warning $"failed to connect to host" ;;
+ *) notify.warning $"curl error (exit code: $retval)" ;;
+ esac
+
+ [ "$retval" = "0" ] &&
+ if [ "$(sed -n "s,.*Invalid Project.*,error,pi" $fcurlout)" != \
+ "error" ]; then
+ [ "$src_name" ] || src_name="$specname"
+
+ pck_file=`grep -i -m1 "/download" $fcurlout | \
+grep -i "$src_name" | \
+sed -n "s,.*\"\([^\"]*\)\/download\".*,\1,pi"`
+ notify.debug "pck_file = \"$pck_file\""
+ [ "$src_name" ] && unset src_name
+
+ new_version=`echo $pck_file | sed -n "\
+/[0-9]/!q # return nothing if no number is found in the package name
+s,.*/,, # remove directory name, if any
+s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
+/-[0-9]*/{s/.*-\([0-9]*.*\)/\1/p;q} # <pck_name>-<pck_ver>
+/_[0-9]*/{s/.*_\([0-9]*.*\)/\1/p;q} # <pck_name>_<pck_ver>
+/[^-\.][0-9]\./{s/.*[^-\.]\([0-9]\..*\)/\1/p;q} # <pck_name><pck_ver>
+# <pck_name> (no version, but <pck_name> can end with numbers)
+/^[^0-9]*[0-9]*$/q"`
+ fi
+ fi
+
+ if [ "$new_version" ]; then
+ notify.note "* "$"found version:"" \`${NOTE}$new_version${NORM}'"
+ last_version="$new_version"
+ fi
+
# check at the other supported web sites...
# skip perl packages to prevent name confusion; these are checked above via Source0

View File

@ -0,0 +1,12 @@
diff -Nru autospec-1.4.15.orig//plugins/pck-update.in autospec-1.4.15/plugins/pck-update.in
--- autospec-1.4.15.orig//plugins/pck-update.in 2010-03-24 21:40:44.000000000 +0100
+++ autospec-1.4.15/plugins/pck-update.in 2010-04-03 14:13:54.314056254 +0200
@@ -2138,7 +2138,7 @@
# check if we are cross-compiling
[ "$BUILD_ARCH" != "$target_cpu" ] &&
- rpmbuild_opts="$rpmbuild_opts --target $target_cpu"
+ rpmbuild_opts="--target $target_cpu $rpmbuild_opts"
[ "$cleanup" = "1" ] && rpmbuild_opts="$rpmbuild_opts --clean"

View File

@ -0,0 +1,41 @@
diff -Nru autospec-1.4.16.orig//plugins/pck-update.in autospec-1.4.16/plugins/pck-update.in
--- autospec-1.4.16.orig//plugins/pck-update.in 2010-05-06 14:59:25.501216204 +0200
+++ autospec-1.4.16/plugins/pck-update.in 2010-05-06 15:01:13.467091646 +0200
@@ -2137,9 +2137,6 @@
--define=\"%_builddir $build_dir\" \
--define=\"%_tmppath $tmppath_dir\""
- [ "$rpm_rootdir" ] &&
- rpmbuild_opts="$rpmbuild_opts $rpm_root_opts"
-
# check if we are cross-compiling
[ "$BUILD_ARCH" != "$target_cpu" ] &&
rpmbuild_opts="--target $target_cpu $rpmbuild_opts"
@@ -2155,7 +2152,7 @@
# note: exit with error when build requirements are missing
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
eval "rpmbuild --nobuild \
-$rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
+$rpmbuild_opts $rpm_root_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"
@@ -2199,15 +2196,15 @@
elif [ "$norpms" = 1 ]; then
notify.note "${NOTE}"$"building the srpm package""${NORM}..."
eval "\
-rpmbuild -bs $rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1"
+rpmbuild -bs $rpmbuild_opts --nodeps $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1"
elif [ "$nosrpm" = 1 ]; then
notify.note "${NOTE}"$"building the rpm packages""${NORM}..."
eval "\
-rpmbuild -bb $rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1"
+rpmbuild -bb $rpmbuild_opts --nodeps $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1"
else
notify.note "${NOTE}"$"building rpm and srpm packages""${NORM}..."
eval "\
-rpmbuild -ba $rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1"
+rpmbuild -ba $rpmbuild_opts --nodeps $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1"
fi
[ $? -eq 0 ] ||
notify.error $"rpmbuild exited with error code \`$?'"

View File

@ -0,0 +1,15 @@
diff -Nru autospec-1.4.16.orig//plugins/pck-update.in autospec-1.4.16/plugins/pck-update.in
--- autospec-1.4.16.orig//plugins/pck-update.in 2010-05-06 14:57:00.523842465 +0200
+++ autospec-1.4.16/plugins/pck-update.in 2010-05-06 14:58:14.009216091 +0200
@@ -2041,9 +2041,9 @@
local f rpm_provided_by buildrequirements_to_install
for f in ${SPEC_BUILDREQUIRES[@]}; do
unset rpm_provided_by
- rpm --quiet -q --whatprovides $f &>/dev/null
+ rpm --quiet -q $rpm_root_opts --whatprovides $f &>/dev/null
[ $? -eq 0 ] &&
- rpm_provided_by="$(rpm -q --whatprovides $f)"
+ rpm_provided_by="$(rpm -q $rpm_root_opts --whatprovides $f)"
notify.note " * "$"\
build requirement found"": \`${NOTE}$f${NORM}' ""\

View File

@ -0,0 +1,12 @@
diff -Nru autospec-1.4.17.orig//lib/libapse.lib.in autospec-1.4.17/lib/libapse.lib.in
--- autospec-1.4.17.orig//lib/libapse.lib.in 2010-04-12 23:16:34.000000000 +0200
+++ autospec-1.4.17/lib/libapse.lib.in 2010-06-03 03:02:59.489016996 +0200
@@ -313,7 +313,7 @@
notify.note $"looking at"" <${NOTE}$curr_curl_url${NORM}> (\`${NOTE}source0${NORM}')..."
notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
- curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
+ curl $curl_opts_netlink $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
let "retval = $?"
case "$retval" in

View File

@ -0,0 +1,23 @@
diff -Nru autospec-1.4.17.orig//lib/librepository.lib.in autospec-1.4.17/lib/librepository.lib.in
--- autospec-1.4.17.orig//lib/librepository.lib.in 2009-06-28 21:44:48.000000000 +0200
+++ autospec-1.4.17/lib/librepository.lib.in 2010-07-01 03:46:25.369016704 +0200
@@ -361,15 +361,15 @@
sed -n "\
/<a href=\"/{s|.*<a href=\"\([^\"]*\)\".*|\1|;bm;};
/<A HREF=\"/{s|.*<A HREF=\"\([^\"]*\)\".*|\1|;bm;};
- /^$pck_name-\(svn\)\?[0-9]\+/bm;be;
- :m;/^$pck_name-\(svn\)\?[0-9]\+/{s,.*,$curr_arch:&,p}
+ /^$pck_name-[^-]*-[^-]*\.rpm/bm;be;
+ :m;/^$pck_name-[^-]*-[^-]*\.rpm/{s,.*,$curr_arch:&,p}
:e" $flist | grep -v -- "$excludeopt"
else
sed -n "\
/<a href=\"/{s|.*<a href=\"\([^\"]*\)\".*|\1|;bm;};
/<A HREF=\"/{s|.*<A HREF=\"\([^\"]*\)\".*|\1|;bm;};
- /^$pck_name-\(svn\)\?[0-9]\+/bm;be;
- :m;/^$pck_name-\(svn\)\?[0-9]\+/{s,.*,$curr_arch:&,p}
+ /^$pck_name-[^-]*-[^-]*\.rpm/bm;be;
+ :m;/^$pck_name-[^-]*-[^-]*\.rpm/{s,.*,$curr_arch:&,p}
:e" $flist
fi ))
done

View File

@ -0,0 +1,14 @@
diff -Nru autospec-1.4.17.orig//plugins/pck-update.in autospec-1.4.17/plugins/pck-update.in
--- autospec-1.4.17.orig//plugins/pck-update.in 2010-07-01 14:21:58.741780539 +0200
+++ autospec-1.4.17/plugins/pck-update.in 2010-07-01 14:23:39.985642249 +0200
@@ -2671,9 +2671,8 @@
if [ "${ftp_rw_server[$ftp_server_upload_num]}" ]; then
repository.is_reachable "${ftp_rw_server[$ftp_server_upload_num]}"
[ $? -eq 0 ] ||
- { notify.error $"\
+ notify.warning $"\
server unreachable"": \`${ftp_rw_server[$ftp_server_upload_num]}'"
- break; }
else
notify.error $"\
you have no read write access to url#$ftp_server_upload_num"

View File

@ -0,0 +1,15 @@
--- autospec/plugins/pck-update.in 2010-05-12 22:12:11.000000000 +0200
+++ autospec/plugins/pck-update 2010-05-25 16:42:42.000000000 +0200
@@ -2040,10 +2040,8 @@
local f rpm_provided_by buildrequirements_to_install
for f in ${SPEC_BUILDREQUIRES[@]}; do
- unset rpm_provided_by
- rpm --quiet -q $rpm_root_opts --whatprovides $f &>/dev/null
- [ $? -eq 0 ] &&
- rpm_provided_by="$(rpm -q $rpm_root_opts --whatprovides $f)"
+ rpm_provided_by="$(rpm -q $rpm_root_opts --whatprovides $f)"
+ [ $? -eq 0 ] || unset rpm_provided_by
notify.note " * "$"\
build requirement found"": \`${NOTE}$f${NORM}' ""\

View File

@ -0,0 +1,130 @@
diff -Nru autospec-1.4.17.org//lib/libspec.lib.in autospec-1.4.17/lib/libspec.lib.in
--- autospec-1.4.17.org//lib/libspec.lib.in 2010-05-02 22:17:42.000000000 +0200
+++ autospec-1.4.17/lib/libspec.lib.in 2010-07-02 23:06:02.245892733 +0200
@@ -657,6 +657,18 @@
{ # 'return' required if 'EXIT_FUNC' == 'return'
notify.error $"specfile not found"": \`$specfile'"; return; }
+ # use rpm --specfile --specedit to create a preprocessed specfile
+ local specfile_preprocessed=$(mktemp -q -t libspec.XXXXXXXX) ||
+ notify.error $"can't create temporary files"
+
+ local rpmdefine_opts="\
+$(for i in `seq 1 1 ${#define_list_name[*]}`; do
+echo -n " --define=\"${define_list_name[$i-1]} ${define_list_value[$i-1]}\""
+done)"
+
+ eval "rpm -q --specfile --specedit $specfile $rpmdefine_opts >> $specfile_preprocessed" ||
+ notify.error $"rpm exited with error code \`$?'"
+
[ -r "$infofile" ] && . $infofile
# when this library is used by external scripts this assertion always fails
@@ -889,7 +901,7 @@
;;
SPEC_TARGET)
[ "$SPEC_TARGET" ] && continue
- [ "$SPEC_NAME" ] || specfile.getvars -s "$specfile" SPEC_NAME
+ [ "$SPEC_NAME" ] || specfile.getvars -s "$specfile_preprocessed" SPEC_NAME
local ifexpr ifexpr_level level boolexpr tok toksave filesname
let "ifexpr_level = 0" # level of nested %if statements
@@ -920,7 +932,7 @@
case ${tok[0]} in
%if)
- #ifexpr=$(rpmvars.solve "${tok2}${fromtok3}" "$specfile")
+ #ifexpr=$(rpmvars.solve "${tok2}${fromtok3}" "$specfile_preprocessed")
# note: if <%var> is undefined (not present) or set to "0"
# then the conditional expression is false else is true
let "ifexpr_level += 1"
@@ -993,7 +1005,7 @@
notify.debug "\
$FUNCNAME: %file block found (${tok[*]})[line#$linenum]"
filesname="$( \
- rpmvars.solve "${tok[*]}" "$specfile" | \
+ rpmvars.solve "${tok[*]}" "$specfile_preprocessed" | \
sed -n '
# remove "%files" and "-f file-name" option if present
s,%files[ \t]*,,;s,-f[ \t]\+[^ ]*[ \t]*,,;p' )"
@@ -1006,11 +1018,11 @@
filesname="$(echo $filesname | sed 's,-n[ \t]\+,,')"
SPEC_TARGET=( \
${SPEC_TARGET[*]} \
-"$(rpmvars.solve "$filesname" "$specfile")" )
+"$(rpmvars.solve "$filesname" "$specfile_preprocessed")" )
;;
*) SPEC_TARGET=(\
${SPEC_TARGET[*]} "$SPEC_NAME-$(\
-rpmvars.solve "$filesname" "$specfile")" )
+rpmvars.solve "$filesname" "$specfile_preprocessed")" )
;;
esac
notify.debug "$FUNCNAME: $var = ( ${SPEC_TARGET[*]} )"
@@ -1023,7 +1035,7 @@
fi
;;
esac
- done < $specfile
+ done < $specfile_preprocessed
#notify.debug "$FUNCNAME: $var = ( ${SPEC_TARGET[*]} )"
;;
SPEC_OBSOLETES)
@@ -1032,7 +1044,7 @@
# entries when no obsolete labels are found
[ "$SPEC_OBSOLETES" ] && continue
- [ "$SPEC_NAME" ] || specfile.getvars -s "$specfile" SPEC_NAME
+ [ "$SPEC_NAME" ] || specfile.getvars -s "$specfile_preprocessed" SPEC_NAME
local linenum=0
while read -r -a tok; do
@@ -1062,19 +1074,19 @@
notify.debug "\
$FUNCNAME: * entry found at line $linenum: \"${tok[*]}\""
SPEC_OBSOLETES[${#SPEC_OBSOLETES[*]}]="\
-$(rpmvars.solve "${tok[*]}" "$specfile")"
+$(rpmvars.solve "${tok[*]}" "$specfile_preprocessed")"
notify.debug "\
$FUNCNAME: SPEC_OBSOLETES = ( ${SPEC_OBSOLETES[*]} )"
;;
esac
- done < $specfile
+ done < $specfile_preprocessed
# SPEC_OBSOLETES=($(sed -n "\
# /^[ \t]*Obsoletes[ \t]*:/{
# s,[ \t]*Obsoletes[ \t]*:[ \t]*,,
# s,%[{]*name[}]*,$SPEC_NAME,;p}" \
- # $specfile))
+ # $specfile_preprocessed))
notify.debug "$FUNCNAME: $var = ( ${SPEC_OBSOLETES[*]} )"
;;
@@ -1095,7 +1107,7 @@
[ "$SPEC_BUILDREQUIRES" ] && continue
local f rpm_provided_by
SPEC_BUILDREQUIRES=(`sed -n \
-'/^BuildRequires/{s,BuildRequires[ \t]*:[ \t]*,,p}' $specfile | \
+'/^BuildRequires/{s,BuildRequires[ \t]*:[ \t]*,,p}' $specfile_preprocessed | \
(IFS="$IFS,"; while read -a buildreqs; do
let "isver = 0"
for f in ${buildreqs[@]}; do
@@ -1107,7 +1119,7 @@
let "isver = 1"
;;
*%*) # rpm variable(s) (ex. '%{__install_info}')
- echo "$(rpmvars.solve "$f" $specfile) "
+ echo "$(rpmvars.solve "$f" $specfile_preprocessed) "
;;
*) echo "$f " ;;
esac
@@ -1154,6 +1166,7 @@
;;
esac
done
+ [ -e $specfile_preprocessed ] && rm -f $specfile_preprocessed
}

View File

@ -0,0 +1,246 @@
diff -Nru autospec-1.4.4.orig/lib/librepository.lib.in autospec-1.4.4/lib/librepository.lib.in
--- autospec-1.4.4.orig/lib/librepository.lib.in 2008-12-08 19:35:19.000000000 +0100
+++ autospec-1.4.4/lib/librepository.lib.in 2008-12-31 05:19:14.000000000 +0100
@@ -84,11 +84,11 @@
local ARGS
ARGS=`LANG=C getopt \
-o n:r:p:u: \
- --long urlnum:,urllist:,proxy:,proxy-user: \
+ --long urlnum:,urllist:,proxy:,proxy-user:,user:,urllistrw: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
- local i urlnum urllist proxy proxy_user
+ local i urlnum urllist proxy proxy_user user urllistrw
eval set -- "$ARGS"
while :; do
@@ -111,6 +111,16 @@
proxy_user="$2"; shift
notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
+ -l|--user)
+ user="$2"; shift
+ notify.debug "$FUNCNAME: user = \"$proxy_user\""
+ ;;
+ -w|--urllistrw)
+ urllistrw=($2); shift
+ for i in `seq 1 1 ${#urllistrw[*]}`; do
+ notify.debug "$FUNCNAME: urllistrw[$(($i-1))] = ${urllistrw[$i-1]}"
+ done
+ ;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error: bad command \`$1'" ;;
@@ -135,10 +145,14 @@
# FIXME: 'curl_opts_netlink' is an external variable
local curlopts="\
-L --silent --list-only $curl_opts_netlink\
+${user:+ --user $user} \
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
local flist currflist currurl
local errors=0
+
+ [ "${user}" ] && urllist=(${urllistrw[*]})
+
let "i = 0"
for currurl in ${urllist[*]}; do
# get the list of files from the repository
@@ -160,6 +174,8 @@
#notify.debug "curl $curlopts --url $currurl/"
curl $curlopts --url $currurl/ -o $currflist
let "retval = $?"
+
+ notify.debug "$FUNCNAME: curl $curlopts --url $currurl/ -o $currflist"
notify.debug "$FUNCNAME: curl return code: $retval"
case "$retval" in
@@ -223,6 +239,7 @@
# -c,--target-cpu : set the build architecture
# -p,--proxy : proxy server
# -u,--proxy-user : proxy user
+# -l,--user : login user
# return value:
# 0 on success, >0 otherwise
# example of output:
@@ -233,13 +250,13 @@
function repository.get_RPMS_name() {
ARGS=`LANG=C getopt \
-o a:x:c:p:u: \
- --long archlist:,exclude:,target-cpu:,proxy:,proxy-user: \
+ --long archlist:,exclude:,target-cpu:,proxy:,proxy-user:,user: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"(bug)"" -- $FUNCNAME: "$"\`getopt' error"
eval set -- "$ARGS"
- local archlist excludeopt proxy proxy_user target_cpu
+ local archlist excludeopt proxy proxy_user user target_cpu
while :; do
case $1 in
-a|--archlist)
@@ -262,6 +279,10 @@
proxy_user="$2"; shift
notify.debug "$FUNCNAME: proxy_user = \"$proxy_user\""
;;
+ -l|--user)
+ user="$2"; shift
+ notify.debug "$FUNCNAME: user = \"$proxy_user\""
+ ;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error" ;;
@@ -309,6 +330,7 @@
# FIXME: 'curl_opts_netlink' is an external variable
local curlopts="\
-L --silent --list-only $curl_opts_netlink -o $flist\
+${user:+ --user $user} \
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
got_RPM_FILENAME=
diff -Nru autospec-1.4.4.orig/plugins/pck-update.in autospec-1.4.4/plugins/pck-update.in
--- autospec-1.4.4.orig/plugins/pck-update.in 2008-12-18 20:49:37.000000000 +0100
+++ autospec-1.4.4/plugins/pck-update.in 2008-12-31 05:20:28.000000000 +0100
@@ -1053,16 +1053,53 @@
notify.error $"can't create temporary files"
notify.debug "$FUNCNAME: infofile = $infofile"
+ local upload_ftp_server
+ local upload_ftp_rpms_dir
+ local upload_ftp_srpms_dir
+ local upload_ftp_port
+ local upload_ftp_user
+ local upload_ftp_passwd
+
+ # select the server where the new packages will be uploaded
+ upload_ftp_server=${ftp_rw_server[$ftp_server_upload_num]}
+ notify.debug "upload_ftp_server = \"$upload_ftp_server\""
+ [ "$upload_ftp_server" ] || notify.error "\
+\`ftp_rw_server[$ftp_server_upload_num]': "$"unset in the configuration files"
+
+ # get the folder where the new rpm packages will be uploaded
+ upload_ftp_rpms_dir=${ftp_rw_rpms_dir[$ftp_server_upload_num]}
+ notify.debug "upload_ftp_rpms_dir = \"$upload_ftp_rpms_dir\""
+ [ "$upload_ftp_rpms_dir" ] || notify.error "\
+\`ftp_rw_rpms_dir[$ftp_server_upload_num]': "$"unset in the configuration files"
+
+ # get the folder where the new srpm package will be uploaded
+ upload_ftp_srpms_dir=${ftp_rw_srpms_dir[$ftp_server_upload_num]}
+ notify.debug "upload_ftp_srpms_dir = \"$upload_ftp_srpms_dir\""
+ [ "$upload_ftp_srpms_dir" ] || notify.error "\
+\`ftp_rw_srpms_dir[$ftp_server_upload_num]': "$"unset in the configuration files"
+
+ upload_ftp_port=${ftp_rw_port[$ftp_server_upload_num]}
+ [ "$ftp_rw_user_forced" ] &&
+ upload_ftp_user="$ftp_rw_user_forced" ||
+ upload_ftp_user="${ftp_rw_user[$ftp_server_upload_num]}"
+ [ "$ftp_rw_passwd_forced" ] &&
+ upload_ftp_passwd="$ftp_rw_passwd_forced" ||
+ upload_ftp_passwd="${ftp_rw_passwd[$ftp_server_upload_num]}"
+
for step in ${steps[*]}; do
case $step in
0) notify.note "[${NOTE}step $step${NORM}] -- ${NOTE}"$"\
check for available versions in the repositories""${NORM}"
local srpm_pck_found=0
+
if [ "$ftp_server_download_num" ]; then
repository.get_SRPMS_name \
--urllist "${ftpurl_ro_srpms[$ftp_server_download_num]}" \
--urlnum "$ftp_server_download_num" \
+ --user "$upload_ftp_user:$upload_ftp_passwd" \
+ --urllistrw "$upload_ftp_server${upload_ftp_port:+:upload_ftp_port}/\
+$upload_ftp_srpms_dir/" \
--proxy "$proxy" \
--proxy-user "$proxy_user" \
"$pck_name"
@@ -1079,9 +1116,13 @@
fi
else
for i in `seq 1 1 ${#ftp_rw_server[*]}`; do
+
repository.get_SRPMS_name \
--urllist "${ftpurl_ro_srpms[$(($i-1))]}" \
--urlnum "$(($i-1))" \
+ ${upload_ftp_user:+ --user "$upload_ftp_user:$upload_ftp_passwd"} \
+ --urllistrw "$upload_ftp_server${upload_ftp_port:+:upload_ftp_port}/\
+$upload_ftp_srpms_dir/" \
--proxy "$proxy" \
--proxy-user "$proxy_user" \
"$pck_name"
@@ -1113,6 +1154,9 @@
repository.get_SRPMS_name \
--urllist "${ftpurl_ro_srpms[$ftp_server_download_num]}" \
--urlnum "$ftp_server_download_num" \
+ ${upload_ftp_user:+ --user "$upload_ftp_user:$upload_ftp_passwd"} \
+ --urllistrw "$upload_ftp_server${upload_ftp_port:+:upload_ftp_port}/\
+$upload_ftp_srpms_dir/" \
--proxy "$proxy" \
--proxy-user "$proxy_user" \
"$pck_name"
@@ -1141,12 +1185,14 @@
cd $srpms_dir
curl $curl_options \
+ ${upload_ftp_user:+ --user $upload_ftp_user:$upload_ftp_passwd} \
${proxy:+ --proxy $proxy}${proxyuser:+ --proxy-user $proxy_user} \
$got_SPEC_FILENAME_URL/$got_SPEC_FILENAME
[[ $? -eq 0 ]] &&
notify.note $"got from"" \`$got_SPEC_FILENAME_URL'" ||
notify.debug "\
curl $curl_options\
+${upload_ftp_user:+ --user $upload_ftp_user:$upload_ftp_passwd} \
${proxy:+ --proxy $proxy}${proxyuser:+ --proxy-user $proxy_user} \
$got_SPEC_FILENAME_URL/$got_SPEC_FILENAME: [${CRIT}FAILED${NORM}]" )
@@ -2552,6 +2598,9 @@
repository.get_SRPMS_name \
--urllist "${ftpurl_ro_srpms[$ftp_server_upload_num]}" \
--urlnum "$ftp_server_upload_num" \
+ ${upload_ftp_user:+ --user "$upload_ftp_user:$upload_ftp_passwd"} \
+ --urllistrw "$upload_ftp_server${upload_ftp_port:+:upload_ftp_port}/\
+$upload_ftp_srpms_dir/" \
--proxy "$proxy" \
--proxy-user "$proxy_user" \
"$pck_name" ${SPEC_OBSOLETES[@]}
@@ -2662,38 +2711,6 @@
[ "${ftp_rw_passive_mode[$ftp_server_upload_num]}" = "on" ] &&
ftp_opts="$ftp_opts --ftp-pasv"
- local upload_ftp_server
- local upload_ftp_rpms_dir
- local upload_ftp_srpms_dir
- local upload_ftp_port
- local upload_ftp_user
- local upload_ftp_passwd
-
- # select the server where the new packages will be uploaded
- upload_ftp_server=${ftp_rw_server[$ftp_server_upload_num]}
- notify.debug "upload_ftp_server = \"$upload_ftp_server\""
- [ "$upload_ftp_server" ] || notify.error "\
-\`ftp_rw_server[$ftp_server_upload_num]': "$"unset in the configuration files"
-
- # get the folder where the new rpm packages will be uploaded
- upload_ftp_rpms_dir=${ftp_rw_rpms_dir[$ftp_server_upload_num]}
- notify.debug "upload_ftp_rpms_dir = \"$upload_ftp_rpms_dir\""
- [ "$upload_ftp_rpms_dir" ] || notify.error "\
-\`ftp_rw_rpms_dir[$ftp_server_upload_num]': "$"unset in the configuration files"
-
- # get the folder where the new srpm package will be uploaded
- upload_ftp_srpms_dir=${ftp_rw_srpms_dir[$ftp_server_upload_num]}
- notify.debug "upload_ftp_srpms_dir = \"$upload_ftp_srpms_dir\""
- [ "$upload_ftp_srpms_dir" ] || notify.error "\
-\`ftp_rw_srpms_dir[$ftp_server_upload_num]': "$"unset in the configuration files"
-
- upload_ftp_port=${ftp_rw_port[$ftp_server_upload_num]}
- [ "$ftp_rw_user_forced" ] &&
- upload_ftp_user="$ftp_rw_user_forced" ||
- upload_ftp_user="${ftp_rw_user[$ftp_server_upload_num]}"
- [ "$ftp_rw_passwd_forced" ] &&
- upload_ftp_passwd="$ftp_rw_passwd_forced" ||
- upload_ftp_passwd="${ftp_rw_passwd[$ftp_server_upload_num]}"
notify.note "\
${NOTE}"$"upload the new packages to the ftp repository"" \

View File

@ -0,0 +1,108 @@
diff -Nru autospec-1.4.4.orig/lib/libapse.lib.in autospec-1.4.4/lib/libapse.lib.in
--- autospec-1.4.4.orig/lib/libapse.lib.in 2009-01-03 14:12:01.000000000 +0100
+++ autospec-1.4.4/lib/libapse.lib.in 2009-01-03 14:13:26.000000000 +0100
@@ -411,62 +411,64 @@
last_version="$new_version"
fi
- # check at the other supported web sites...
- for i in ${!apse_site_name[@]}; do
- notify.note \
+ # check at the other supported web sites.
+ # Skip Perl packages to prevent name confusion; these are checked above via Source0
+ if [ ! "$(echo $pckurl | grep "cpan.org")" ]; then
+ for i in ${!apse_site_name[@]}; do
+ notify.note \
$"looking at"" <${NOTE}${apse_site_name[$i]}${NORM}>..."
- for search_name in $src_name $specname; do
- [ "${apse_put_fields[$i]}" ] &&
- curr_curl_url="${apse_uri[$i]}" ||
- curr_curl_url="${apse_uri[$i]}${search_name}"
+ for search_name in $src_name $specname; do
+ [ "${apse_put_fields[$i]}" ] &&
+ curr_curl_url="${apse_uri[$i]}" ||
+ curr_curl_url="${apse_uri[$i]}${search_name}"
- if [ "${apse_put_fields[$i]}" ]; then
- notify.debug "\
+ if [ "${apse_put_fields[$i]}" ]; then
+ notify.debug "\
curl \$curr_curl_proxy_opts -s -L -F ${apse_put_fields[$i]}${search_name} \"$curr_curl_url\""
- curl $curr_curl_proxy_opts -s -L -F \
- ${apse_put_fields[$i]}${search_name} "$curr_curl_url" > $fcurlout
- else
- notify.debug "\
+ curl $curr_curl_proxy_opts -s -L -F \
+ ${apse_put_fields[$i]}${search_name} "$curr_curl_url" > $fcurlout
+ else
+ notify.debug "\
curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
- curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
- fi
+ curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
+ fi
- let "retval = $?"
- case "$retval" in
- 0) ;;
- 6) notify.warning $"couldn't resolve host" ;;
- 7) notify.warning $"failed to connect to host" ;;
- *) notify.warning $"curl error (exit code: $retval)" ;;
- esac
+ let "retval = $?"
+ case "$retval" in
+ 0) ;;
+ 6) notify.warning $"couldn't resolve host" ;;
+ 7) notify.warning $"failed to connect to host" ;;
+ *) notify.warning $"curl error (exit code: $retval)" ;;
+ esac
- [ "$retval" = "0" ] || continue
+ [ "$retval" = "0" ] || continue
- if [ "$(cat $fcurlout | sed -n "\
+ if [ "$(cat $fcurlout | sed -n "\
s,.*${apse_error_msg[$i]}.*,error,pi")" != \
- "error" ]; then
- current_grep="$(echo "${apse_grep[$i]}" | sed -e "s,\${search_name},${search_name},g")"
- current_sed="$(echo "${apse_sed[$i]}" | sed -e "s,\${search_name},${search_name},g")"
- notify.debug "\
+ "error" ]; then
+ current_grep="$(echo "${apse_grep[$i]}" | sed -e "s,\${search_name},${search_name},g")"
+ current_sed="$(echo "${apse_sed[$i]}" | sed -e "s,\${search_name},${search_name},g")"
+ notify.debug "\
grep -i -m1 \"$current_grep\" \$fcurlout | sed -n \"$current_sed\""
- new_version=$(grep -i -m1 "$current_grep" $fcurlout | sed -n "$current_sed")
- if [ "$new_version" ]; then
- notify.note "\
+ new_version=$(grep -i -m1 "$current_grep" $fcurlout | sed -n "$current_sed")
+ if [ "$new_version" ]; then
+ notify.note "\
* "$"found version:"" \`${NOTE}$new_version${NORM}'"
- if [ "$last_version" ]; then
- notify.debug "apse.cmpversion \"$last_version\" \"$new_version\""
- apse.cmpversion "$last_version" "$new_version"
- [ $? -eq 2 ] && last_version="$new_version"
- else
- last_version="$new_version"
+ if [ "$last_version" ]; then
+ notify.debug "apse.cmpversion \"$last_version\" \"$new_version\""
+ apse.cmpversion "$last_version" "$new_version"
+ [ $? -eq 2 ] && last_version="$new_version"
+ else
+ last_version="$new_version"
+ fi
fi
fi
- fi
+ done
done
- done
+ fi
unset APSE_LAST_VERSION
-
if [ "$last_version" ]; then
APSE_LAST_VERSION="${last_version/-/.}"
notify.note $"\

View File

@ -0,0 +1,105 @@
diff -Nru autospec-1.4.4.orig/lib/libapse.lib.in autospec-1.4.4/lib/libapse.lib.in
--- autospec-1.4.4.orig/lib/libapse.lib.in 2008-12-18 23:01:10.000000000 +0100
+++ autospec-1.4.4/lib/libapse.lib.in 2009-01-02 13:45:55.000000000 +0100
@@ -230,7 +230,7 @@
local ARGS
ARGS=`LANG=C getopt -o han:s:w:p:u: \
- --long help,allurl,pckname:,specname:,pckurl:,proxy:,proxy-user: \
+ --long help,allurl,pckname:,specname:,pckurl:,pckurlverbatim:,proxy:,proxy-user: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error"
@@ -253,6 +253,10 @@
pckurl="$2"; shift
notify.debug "$FUNCNAME: pckurl = \"$pckurl\""
;;
+ -v|--pckurlverbatim)
+ pckurlverbatim="$2"; shift
+ notify.debug "$FUNCNAME: pckurlverbatim = \"$pckurlverbatim\""
+ ;;
-p|--proxy)
proxy="$2"; shift
notify.debug "$FUNCNAME: proxy = \"$proxy\""
@@ -291,12 +295,11 @@
local curr_curl_proxy_opts="\
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
- # sourceforge.net, sf.net
+ # sourceforge.net, sf.net
local prj_name prj_group_id
if [ "$(echo $pckurl | grep "sourceforge.net\|sf.net")" ]; then
- notify.note $"looking at"" <${NOTE}http://sourceforge.net${NORM}>..."
prj_name=$(echo "$pckurl" | sed -n 's,.*/\(.*\)/.*,\1,p')
[ "$prj_name" ] || notify.error $"\
@@ -364,11 +367,48 @@
fi
fi
fi
+
+ else
+
+ # SOURCE url based search
+ notify.note $"looking at"" "$"source0 base directory..."
+ local pckurldir="`dirname $pckurl`/"
+ local pcknameverbatim=`basename $pckurlverbatim`
+
+ curr_curl_url="\
+$pckurldir"
+ notify.debug "curl $curr_curl_proxy_opts -s -L \"$curr_curl_url\""
+
+ curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
+ let "retval = $?"
+ case "$retval" in
+ 0) ;;
+ 6) notify.warning $"couldn't resolve host" ;;
+ 7) notify.warning $"failed to connect to host" ;;
+ *) notify.warning $"curl error (exit code: $retval)" ;;
+ esac
+
+ local pcknameregexp=$(echo $pcknameverbatim | sed "\
+ s,%[{]*name[}]*,$specname,
+ s,%{.*}*,[^[:space:]-]*,")
+
+ if [ $? -eq 0 ]; then
+
+ new_version=$(\
+grep -i "$pcknameregexp" $fcurlout | sed "\
+ s,.*\($pcknameregexp\).*,\1,g
+ s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
+ s/.*-\([0-9]*.*\)/\1/ # <pck_name>-<pck_ver>
+ s/.*_\([0-9]*.*\)/\1/ # <pck_name>_<pck_ver>
+ s/.+\([0-9]\..*\)/\1/g # <pck_name><pck_ver>
+ " | sort -t. -n -r -k1 -k2 -k3 -k4 -k5 -k6 -k7 -k8 -k9 -k10| head -n1)
+
+ fi
fi
if [ "$new_version" ]; then
- notify.note "* "$"found version:"" \`${NOTE}$new_version${NORM}'"
- last_version="$new_version"
+ notify.note "* "$"found version:"" \`${NOTE}$new_version${NORM}'"
+ last_version="$new_version"
fi
# check at the other supported web sites...
diff -Nru autospec-1.4.4.orig/plugins/pck-update.in autospec-1.4.4/plugins/pck-update.in
--- autospec-1.4.4.orig/plugins/pck-update.in 2009-01-01 23:01:36.000000000 +0100
+++ autospec-1.4.4/plugins/pck-update.in 2009-01-01 23:04:59.000000000 +0100
@@ -1253,9 +1253,13 @@
unset SPEC_SOURCE0_PCKNAME
specfile.getvars SPEC_SOURCE0_PCKNAME
+ unset SPEC_SOURCE0_VERBATIM
+ specfile.getvars --verbatim SPEC_SOURCE0
+
apse.scrapeversion \
--pckname "$SPEC_SOURCE0_PCKNAME" \
--pckurl "${SPEC_SOURCE[0]}" \
+ --pckurlverbatim "${SPEC_SOURCE0_VERBATIM}" \
--specname "$SPEC_NAME" \
${proxy:+ --proxy $proxy} \
${proxy_user:+ --proxy-user $proxy_user}

View File

@ -0,0 +1,29 @@
--- autospec.conf.in.orig 2009-02-24 01:58:37.000000000 +0100
+++ autospec.conf.in 2009-02-24 01:58:49.000000000 +0100
@@ -418,7 +418,7 @@
apse_uri[1]="http://linux.softpedia.com/progSearch"
apse_put_fields[1]="src="
apse_error_msg[1]="No results found"
-apse_grep[1]="<b[^<]*\${search_name} "
+apse_grep[1]="<b[^<]*\${search_name}[^a-zA-Z]"
apse_sed[1]="s,.*<b[^<]*\${search_name}[^<]*[ ]\([^ <]*\)</b>.*,\1,pi"
apse_site_name[2]="http://www.gnomefiles.org"
@@ -439,14 +439,14 @@
apse_uri[4]="http://sourcewell.berlios.de/appsearch.php?by=Importance&search="
apse_put_fields[4]=""
apse_error_msg[4]="No Application found"
-apse_grep[4]="appbyid.*\${search_name}.*Stable"
+apse_grep[4]="appbyid.*\${search_name}[^a-zA-Z].*Stable"
apse_sed[4]="s,.*<a href=\"appbyid.*\">\${search_name} \([^ <]*\)</a>.*,\1,pi"
apse_site_name[5]="http://distrowatch.com"
-apse_uri[5]="http://distrowatch.com/packages.php ?"
+apse_uri[5]="http://distrowatch.com/packages.php?"
apse_put_fields[5]=""
apse_error_msg[5]="is currently being redesigned"
-apse_grep[5]="td.*\${search_name}"
+apse_grep[5]="td.*[^a-zA-Z]\${search_name}[^a-zA-Z0-9]"
apse_sed[5]="s,.*td><[^>]*>\([^ <]*\)<.*,\1,pi"
#------------------------------------------------------------------------------

View File

@ -0,0 +1,12 @@
--- libapse.lib.in.2 2009-02-28 19:34:40.000000000 +0100
+++ libapse.lib.in 2009-02-28 19:34:55.000000000 +0100
@@ -392,7 +392,8 @@
local pcknameregexp=$(echo $pcknameverbatim | sed "\
s,%[{]*name[}]*,$specname,
- s,%{.*}*,[^[:space:]-]*,")
+ s,%[{]*version[}]*,[A-Za-z0-9._]*,
+ s,%[{]*.*[}]*,[^[:space:]-]*,")
if [ $? -eq 0 ]; then
new_version=$(\

View File

@ -0,0 +1,11 @@
--- libapse.lib.in 2009-02-28 19:34:55.000000000 +0100
+++ libapse.lib.in.new 2009-03-02 18:46:02.000000000 +0100
@@ -403,7 +403,7 @@
s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
s/.*-\([0-9]*.*\)/\1/ # <pck_name>-<pck_ver>
s/.*_\([0-9]*.*\)/\1/ # <pck_name>_<pck_ver>
-s/.+\([0-9]\..*\)/\1/g # <pck_name><pck_ver>" | \
+s/[^0-9]*\([0-9]\..*\)/\1/g # <pck_name><pck_ver> | \
sort -t. -n -r -k1 -k2 -k3 -k4 -k5 -k6 -k7 -k8 -k9 -k10 | head -n1)
fi

View File

@ -0,0 +1,86 @@
diff -Nru autospec-1.4.6.ori/lib/libapse.lib.in autospec-1.4.6/lib/libapse.lib.in
--- autospec-1.4.6.ori/lib/libapse.lib.in 2009-04-10 19:47:03.000000000 +0200
+++ autospec-1.4.6/lib/libapse.lib.in 2009-07-01 02:29:14.912684915 +0200
@@ -294,81 +294,8 @@
local curr_curl_proxy_opts="\
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
- # sourceforge.net, sf.net
-
- local prj_name prj_group_id
-
- if [ "$(echo $pckurl | grep "sourceforge.net\|sf.net")" ]; then
- notify.note $"looking at"" <${NOTE}http://sourceforge.net${NORM}>..."
-
- prj_name=$(echo "$pckurl" | sed -n 's,.*/\(.*\)/.*,\1,p')
- [ "$prj_name" ] || notify.error $"\
-(bug)"" -- $FUNCNAME: "$"assertion failed:"" \"\$prj_name\" != \"\""
-
- curr_curl_url="http://sourceforge.net/projects/$prj_name"
- notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
- curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
-
- let "retval = $?"
- case "$retval" in
- 0) ;;
- 6) notify.warning $"couldn't resolve host" ;;
- 7) notify.warning $"failed to connect to host" ;;
- *) notify.warning $"curl error (exit code: $retval)" ;;
- esac
-
- [ "$retval" = "0" ] &&
- if [ "$(sed -n "s,.*Invalid Project.*,error,pi" $fcurlout)" != \
- "error" ]; then
- prj_group_id=$(\
- sed -n "s,.*download\.php?group_id=\([0-9]*\).*,\1,pi" \
- $fcurlout)
- [ "$prj_group_id" ] || notify.error $"\
-(bug)"" -- $FUNCNAME: "$"assertion failed:"" \"\$prj_group_id\" != \"\""
-
- curr_curl_url="\
-http://sourceforge.net/export/rss2_projfiles.php?group_id=$prj_group_id"
- notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
-
- curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
- let "retval = $?"
- case "$retval" in
- 0) ;;
- 6) notify.warning $"couldn't resolve host" ;;
- 7) notify.warning $"failed to connect to host" ;;
- *) notify.warning $"curl error (exit code: $retval)" ;;
- esac
-
- if [ $? -eq 0 ]; then
- for search_name in $src_name $specname; do
- new_version=$(\
-grep -i -m1 "$search_name [^ ]* released (.*)</title>" $fcurlout | \
-sed -n "s,.*$search_name \([^ ]*\) released (.*)</title>.*,\1,pi")
- [ "$new_version" ] && break
- done
-
- if [ -z "$new_version" ]; then
- [ "$src_name" ] || src_name="$specname"
-
- pck_file=`grep -i -m1 "Includes files: $src_name" $fcurlout | \
-sed -n "s,.*Includes files: \($src_name[-_0-9]*[^ -]*\) .*,\1,pi"`
- notify.debug "pck_file = \"$pck_file\""
- [ "$src_name" ] && unset src_name
-
- new_version=`echo $pck_file | sed -n "\
-/[0-9]/!q # return nothing if no number is found in the package name
-s,.*/,, # remove directory name, if any
-s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
-/-[0-9]*/{s/.*-\([0-9]*.*\)/\1/p;q} # <pck_name>-<pck_ver>
-/_[0-9]*/{s/.*_\([0-9]*.*\)/\1/p;q} # <pck_name>_<pck_ver>
-/[^-\.][0-9]\./{s/.*[^-\.]\([0-9]\..*\)/\1/p;q} # <pck_name><pck_ver>
-# <pck_name> (no version, but <pck_name> can end with numbers)
-/^[^0-9]*[0-9]*$/q"`
- fi
- fi
- fi
# SOURCE0 url based search (only if 'pckurl' is a valid url)
- elif [[ "$pckurl" =~ .*://.* ]]; then
+ if [[ "$pckurl" =~ .*://.* ]]; then
local pckurldir="`dirname $pckurl`/"
notify.debug "pckurldir = $pckurldir"

View File

@ -0,0 +1,57 @@
diff -Nru autospec-1.4.6.orig/autospec.conf.in autospec-1.4.6/autospec.conf.in
--- autospec-1.4.6.orig/autospec.conf.in 2009-02-25 22:42:41.000000000 +0100
+++ autospec-1.4.6/autospec.conf.in 2009-04-19 14:47:37.000000000 +0200
@@ -533,8 +533,9 @@
#------------------------------------------------------------------------------
# Directories used by the rpm tool to read and save files to
-srpms_dir=`rpm --eval %_srcrpmdir 2>/dev/null`
-rpms_dir=`rpm --eval %_rpmdir 2>/dev/null`
-spec_dir=`rpm --eval %_specdir 2>/dev/null`
-source_dir=`rpm --eval %_sourcedir 2>/dev/null`
-tmppath_dir=`rpm --eval %_tmppath 2>/dev/null`
+srpms_dir="`rpm --eval %_srcrpmdir 2>/dev/null`"
+rpms_dir="`rpm --eval %_rpmdir 2>/dev/null`"
+spec_dir="`rpm --eval %_specdir 2>/dev/null`"
+source_dir="`rpm --eval %_sourcedir 2>/dev/null`"
+build_dir="`rpm --eval %_builddir 2>/dev/null`"
+tmppath_dir="`rpm --eval %_tmppath 2>/dev/null`"
diff -Nru autospec-1.4.6.orig/plugins/pck-update.in autospec-1.4.6/plugins/pck-update.in
--- autospec-1.4.6.orig/plugins/pck-update.in 2009-02-01 22:35:33.000000000 +0100
+++ autospec-1.4.6/plugins/pck-update.in 2009-04-19 14:49:05.000000000 +0200
@@ -1181,7 +1181,10 @@
$spec_dir/${SRPM_SPECFILE}.0.old
fi
- rpm -hiv $srpms_dir/$got_SPEC_FILENAME 2>&1 >/dev/null ||
+ rpm -hiv \
+ --define "%_specdir $spec_dir" \
+ --define "%_sourcedir $source_dir" \
+ $srpms_dir/$got_SPEC_FILENAME 2>&1 >/dev/null ||
notify.error $"\
an error occurred while installing \`$got_SPEC_FILENAME'"
@@ -2106,7 +2109,13 @@
$sdflag "$fullURL" "$source_dir" "$totfilenum"
done
- local rpmbuild_opts
+ local rpmbuild_opts="\
+ --define \"%_srcrpmdir $srpms_dir\" \
+ --define \"%_rpmdir $rpms_dir\" \
+ --define \"%_specdir $spec_dir\" \
+ --define \"%_sourcedir $source_dir\" \
+ --define \"%_builddir $build_dir\" \
+ --define \"%_tmppath $tmppath_dir\""
# check if we are cross-compiling
[ "$BUILD_ARCH" != "$target_cpu" ] &&
@@ -2116,7 +2125,7 @@
# note: exit with error when build requirements are missing
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
- rpmbuild --nobuild $spec_dir/$SRPM_SPECFILE 2>&1 ||
+ rpmbuild --nobuild --define "%_sourcedir $source_dir" $spec_dir/$SRPM_SPECFILE 2>&1 ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"

View File

@ -0,0 +1,9 @@
diff -Nru autospec-1.4.7/autospec.conf.in autospec-1.4.7.patched/autospec.conf.in
--- autospec-1.4.7/autospec.conf.in 2009-06-28 20:18:14.000000000 +0200
+++ autospec-1.4.7.patched/autospec.conf.in 2009-07-08 21:15:25.186969362 +0200
@@ -537,4 +537,5 @@
rpms_dir="`rpm --eval %_rpmdir 2>/dev/null`"
spec_dir="`rpm --eval %_specdir 2>/dev/null`"
source_dir="`rpm --eval %_sourcedir 2>/dev/null`"
+build_dir="`rpm --eval %_builddir 2>/dev/null`"
tmppath_dir="`rpm --eval %_tmppath 2>/dev/null`"

View File

@ -0,0 +1,36 @@
diff -Nru autospec-1.4.7/lib/libapse.lib.in autospec-1.4.7.patched/lib/libapse.lib.in
--- autospec-1.4.7/lib/libapse.lib.in 2009-07-05 19:23:29.000000000 +0200
+++ autospec-1.4.7.patched/lib/libapse.lib.in 2009-07-12 14:16:29.000000000 +0200
@@ -319,19 +319,24 @@
local pcknameregexp=$(echo $pcknameverbatim | sed "\
s,%[{]*name[}]*,$specname,
- s,%[{]*version[}]*,[A-Za-z0-9._]*,
- s,%[{]*.*[}]*,[^[:space:]-]*,")
+ s,%[{]*version[}]*,\\\([A-Za-z0-9._]*\\\),
+ s,%[{]*.*[}]*,[A-Za-z0-9._]*,
+ s,\.gz$,.,
+ s,\.tgz$,.,
+ s,\.bz2$,.,
+ s,\.lzma$,.,")
if [ $? -eq 0 ]; then
- new_version=$(\
+
+ if [ "${pcknameregexp/(/}" = "${pcknameregexp}" ]; then
+ notify.warning "* "$"not parametric source0 name; cannot update"
+ else
+ new_version=$(\
grep -i "$pcknameregexp" $fcurlout | \
sed "\
-s,.*\($pcknameregexp\).*,\1,g
-s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
-s/.*-\([0-9]*.*\)/\1/ # <pck_name>-<pck_ver>
-s/.*_\([0-9]*.*\)/\1/ # <pck_name>_<pck_ver>
-s/[^0-9]*\([0-9]\..*\)/\1/g # <pck_name><pck_ver>" | \
+s,.*$pcknameregexp.*,\1,g" |
sort -t. -n -r -k1 -k2 -k3 -k4 -k5 -k6 -k7 -k8 -k9 -k10 | head -n1)
+ fi
fi
if [ "$new_version" ]; then

View File

@ -0,0 +1,12 @@
diff -Nru autospec-1.4.8.orig/autospec.conf.in autospec-1.4.8/autospec.conf.in
--- autospec-1.4.8.orig/autospec.conf.in 2009-10-14 21:24:36.000000000 +0200
+++ autospec-1.4.8/autospec.conf.in 2009-10-16 12:03:40.000000000 +0200
@@ -446,7 +446,7 @@
apse_uri[5]="http://distrowatch.com/packages.php?"
apse_put_fields[5]=""
apse_error_msg[5]="is currently being redesigned"
-apse_grep[5]="td.*[^a-zA-Z]\${search_name}[^a-zA-Z0-9]"
+apse_grep[5]="td.*/\${search_name}[-_][0-9]"
apse_sed[5]="s,.*td><[^>]*>\([^ <]*\)<.*,\1,pi"
#------------------------------------------------------------------------------

View File

@ -0,0 +1,93 @@
--- lib/libapse.lib.in 2009-10-16 11:50:55.000000000 +0200
+++ lib/libapse.lib.in 2009-07-23 00:16:29.000000000 +0200
@@ -12,6 +12,12 @@
. /usr/share/autospec/lib/libmsgmng.lib
+[ -r /usr/share/autospec/lib/libspec.lib ] ||
+ { echo "$me: "$"library not found"": /usr/share/autospec/lib/libspec.lib" 1>&2
+ exit 1; }
+
+. /usr/share/autospec/lib/libspec.lib
+
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
@@ -317,24 +323,66 @@
*) notify.warning $"curl error (exit code: $retval)" ;;
esac
- local pcknameregexp=$(echo $pcknameverbatim | sed "\
- s,%[{]*name[}]*,$specname,
- s,%[{]*version[}]*,\\\([A-Za-z0-9._]*\\\),
- s,%[{]*.*[}]*,[A-Za-z0-9._]*,
- s,\.gz$,.,
- s,\.tgz$,.,
- s,\.bz2$,.,
- s,\.lzma$,.,")
+ local svar svalue spck candidate_version
+ # filter "?var:" expressions
+ spck=`echo $pcknameverbatim | sed "s,%{?[A-Za-z0-9_]*:.*\(%[A-Za-z0-9_]*\)},\1,"`
+
+ while true; do
+ svar=`echo $spck | sed "\
+ s,.*%[{]*\([A-Za-z0-9_]*\)[}]*.*,\1,"`
+ [ "$svar" = "$spck" ] && break
+ if [ "$svar" = "version" ]; then
+ svalue="\\\([A-Za-z0-9._]*\\\)"
+ else
+ svalue=`rpmvars.solve "%$svar" "$spec_dir/$specname.spec"`
+ [ "$svalue" = "%$svar" ] && svalue=
+ fi
+ spck=`echo $spck | sed "\
+ s,%[{]*$svar[}]*,$svalue,"`
+ done
+ # remove archiver extension from rexexp to match changes
+ local pcknameregexp=$(echo [^A-Za-z0-9._-]$spck | sed "\
+ s,\.gz$,\\\.,
+ s,\.tgz$,\\\.,
+ s,\.bz2$,\\\.,
+ s,\.lzma$,\\\.,
+ s,\.lz$,\\\.,
+ s,\.tbz2$,\\\.,")
+#echo $pcknameregexp
if [ $? -eq 0 ]; then
if [ "${pcknameregexp/(/}" = "${pcknameregexp}" ]; then
notify.warning "* "$"not parametric source0 name; cannot update"
else
- new_version=$(\
+ candidate_versions=($(\
grep -i "$pcknameregexp" $fcurlout | \
sed "\
-s,.*$pcknameregexp.*,\1,g" | \
-sort -t. -n -r -k1 -k2 -k3 -k4 -k5 -k6 -k7 -k8 -k9 -k10 | head -n1)
+s,.*$pcknameregexp.*,\1,g
+s,.*\.md5,,
+s,\.zip$,,
+s,\.tar\.gz$,,
+s,\.tar\.bz2$,,
+s,\.gz$,,
+s,\.tgz$,,
+s,\.bz2$,,
+s,\.lzma$,,
+s,\.i386$,,
+s,\.bin$,,
+s,\.exe$,,
+s,\.dmg$,,
+s,\.tbz2$,,
+s,\.lz$,," |
+sort -t. -n -r -k1 -k2 -k3 -k4 -k5 -k6 -k7 -k8 -k9 -k10 ))
+
+ local curr_version_dots new_version_dots candidate_version
+ curr_version_dots=`echo $SPEC_VERSION | tr -d [0-9][A-Z][a-z]_`
+ for candidate_version in ${candidate_versions[*]}; do
+ # skip version with no dots if current version has at least one (e.g. date release like 20000110)
+ new_version_dots=`echo $candidate_version | tr -d [0-9][A-Z][a-z]_`
+ [ ${#new_version_dots} = 0 -a ${#curr_version_dots} -gt 0 ] && continue
+ new_version=$candidate_version
+ break
+ done
fi
fi

View File

@ -0,0 +1,11 @@
--- autospec-1.4.9/templates/python.orig 2010-01-07 13:40:56.000000000 +0100
+++ autospec-1.4.9/templates/python 2010-01-07 13:44:18.000000000 +0100
@@ -27,6 +27,8 @@
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
python setup.py install \
+ -O1 \
+ --skip-build \
--root="%{buildroot}" \
--install-headers=%{_includedir}/python \
--install-lib=%{python_sitearch}

View File

@ -0,0 +1,17 @@
diff -Nru autospec-1.4.9.orig/templates/python autospec-1.4.9/templates/python
--- autospec-1.4.9.orig/templates/python 2008-05-11 22:41:59.000000000 +0200
+++ autospec-1.4.9/templates/python 2010-01-06 10:55:10.781675316 +0100
@@ -22,11 +22,11 @@
%setup -q
%build
-CFLAGS=\"%{optflags}\" python setup.py build
+CFLAGS=\"%{optflags}\" %{__python} setup.py build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
-python setup.py install \
+%{__python} setup.py install \
--root="%{buildroot}" \
--install-headers=%{_includedir}/python \
--install-lib=%{python_sitearch}

View File

@ -0,0 +1,12 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-02 17:29:37.430222332 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-02 17:30:44.363341447 +0200
@@ -2353,7 +2353,7 @@
buildreq=libpython-devel
else
# unidentified requirement
- buildreq=`rpm -q $req 2>/dev/null | sed "s|\(.*\)-[^-]*-[^-]*|\1|"`
+ buildreq=`rpm -q --whatprovides $req 2>/dev/null | sed "s|\(.*\)-[^-]*-[^-]*|\1|"`
[ "$buildreq" ] || echo "#$req: not found; what is this?" >> $frequires
fi
if [ "${buildreq}" -a "${buildreq/%-devel/}" = "${buildreq}" ]; then

View File

@ -0,0 +1,11 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-04 13:53:29.024307664 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-04 13:56:16.759307837 +0200
@@ -2992,6 +2992,7 @@
# print the old SRPMS package...
[[ -n "$SPEC_FILENAME_old" && \
+ "$nosrpm" != "1" && \
"$SPEC_VERSION_old-$SPEC_RELEASE_old" != \
"$SPEC_VERSION-$SPEC_RELEASE" ]] &&
{ let "srpm_pcks_to_backup = 1"

View File

@ -0,0 +1,15 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update autospec-1.5.0/plugins/pck-update
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-08 17:45:44.896183449 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-08 19:43:32.147316080 +0200
@@ -436,9 +436,9 @@
2>/dev/null >> $specfile_preprocessed" ||
notify.error $"rpm exited with error code \`$?'"
- SPECFILE_PREPROCESSED="$specfile_preprocessed"
- notify.debug "SPECFILE_PREPROCESSED = \"$SPECFILE_PREPROCESSED\""
fi
+ SPECFILE_PREPROCESSED="$specfile_preprocessed"
+ notify.debug "SPECFILE_PREPROCESSED = \"$SPECFILE_PREPROCESSED\""
echo "SPECFILE_PREPROCESSED=\"$SPECFILE_PREPROCESSED\"" >> $infofile
# set the variables 'rpmvar_name[]', 'rpmvar_value[]', 'rpmvar_expr[]'

View File

@ -0,0 +1,13 @@
diff -Nru autospec-1.5.0/plugins/pck-update.in autospec-1.5.0.orig//plugins/pck-update.in
--- autospec-1.5.0/plugins/pck-update.in 2010-08-21 19:13:06.294003023 +0200
+++ autospec-1.5.0.orig//plugins/pck-update.in 2010-08-21 19:12:32.407002798 +0200
@@ -896,8 +896,7 @@
if [ ! "$target_cpu" ]; then
target_cpu="${SPEC_BUILDARCH:-$BUILD_ARCH}"
if [ "$target_cpu" == "noarch" ]; then
+ target_cpu=`rpm --eval %{_host_cpu}`
- set -- ${arch_list[@]}
- target_cpu=$1
fi
fi
notify.debug "target_cpu = $target_cpu"

View File

@ -0,0 +1,43 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-08 17:41:33.864557659 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-08 17:43:53.356307747 +0200
@@ -880,11 +880,11 @@
function specfile.rotate_bck() {
local v
for v in `seq $((${spec_backup_numbers:-5} - 2)) -1 0`; do
- [[ -e $spec_dir/${SRPM_SPECFILE}.$v.old ]] &&
+ [[ -e $spec_dir/.${SRPM_SPECFILE}.$v.old ]] &&
{ notify.debug "\
-[$spec_dir] ${SRPM_SPECFILE}.$v.old --> ${SRPM_SPECFILE}.$(($v + 1)).old"
- mv -f $spec_dir/${SRPM_SPECFILE}.$v.old \
- $spec_dir/${SRPM_SPECFILE}.$(($v + 1)).old; }
+[$spec_dir] .${SRPM_SPECFILE}.$v.old --> .${SRPM_SPECFILE}.$(($v + 1)).old"
+ mv -f $spec_dir/.${SRPM_SPECFILE}.$v.old \
+ $spec_dir/.${SRPM_SPECFILE}.$(($v + 1)).old; }
done
}
@@ -1230,9 +1230,9 @@
if [ -e "$spec_dir/$SRPM_SPECFILE" ]; then
notify.note $"\
making a ${NOTE}backup copy${NORM} of the current specfile""
- --> ${NOTE}$spec_dir/${SRPM_SPECFILE}.0.old${NORM}"
+ --> ${NOTE}$spec_dir/.${SRPM_SPECFILE}.0.old${NORM}"
cp -f $spec_dir/$SRPM_SPECFILE \
- $spec_dir/${SRPM_SPECFILE}.0.old
+ $spec_dir/.${SRPM_SPECFILE}.0.old
fi
rpm -hiv --nodeps \
@@ -1372,9 +1372,9 @@
#
# notify.note $"\
#making a ${NOTE}backup copy${NORM} of the current specfile""
-# --> ${NOTE}$spec_dir/${SRPM_SPECFILE}.0.old${NORM}"
+# --> ${NOTE}$spec_dir/.${SRPM_SPECFILE}.0.old${NORM}"
# cp -f $SRPM_SPECFILE_WITH_PATH \
-# ${SRPM_SPECFILE_WITH_PATH}.0.old
+# .${SRPM_SPECFILE_WITH_PATH}.0.old
notify.note $"${NOTE}updating${NORM} the new specfile \
\`${NOTE}$spec_dir/$SRPM_SPECFILE${NORM}'""..."

View File

@ -0,0 +1,12 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-07-17 23:00:50.000000000 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-07-31 19:55:55.222342783 +0200
@@ -1235,7 +1235,7 @@
$spec_dir/${SRPM_SPECFILE}.0.old
fi
- rpm -hiv \
+ rpm -hiv --nodeps \
--define "%_specdir $spec_dir" \
--define "%_sourcedir $source_dir" \
$srpms_dir/$got_SPEC_FILENAME 2>&1 >/dev/null ||

View File

@ -0,0 +1,80 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-16 14:02:21.485570021 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-16 14:03:53.353694250 +0200
@@ -2269,8 +2269,13 @@
for pck in ${SPEC_TARGET[*]}; do
# FIXME : we should check and complain if the package has
# been built for a different architecture
- filename="$rpms_dir/$target_cpu/\
+ if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" == "noarch" ]; then
+ filename="$rpms_dir/noarch/\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.noarch.rpm"
+ else
+ filename="$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
+ fi
#notify.note " * $filename"
[ -e $filename ] ||
notify.error $"package not found"": \`$filename'"
@@ -2283,8 +2288,13 @@
for pck in ${SPEC_TARGET[*]}; do
# FIXME : we should check and complain if the package has
# been built for a different architecture
- filename="$rpms_dir/$target_cpu/\
+ if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" == "noarch" ]; then
+ filename="$rpms_dir/noarch/\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.noarch.rpm"
+ else
+ filename="$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
+ fi
notify.note " * $filename"
#[ -e $filename ] ||
# notify.error $"package not found"": \`$filename'"
@@ -2389,9 +2399,14 @@
for pck in ${SPEC_TARGET[*]}; do
# FIXME : we should check and complain if the package has
# been built for a different architecture
- filename="$rpms_dir/$target_cpu/\
+ if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" == "noarch" ]; then
+ filename="$rpms_dir/noarch/\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.noarch.rpm"
+ else
+ filename="$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
- notify.note " * $filename"
+ fi
+ notify.note " * $filename"
[ -e $filename ] ||
notify.error $"package not found"": \`$filename'"
done
@@ -2578,8 +2593,13 @@
$tool -b $filename | sed "s,*.*/\(.*\),\1,"
local i=0
for pck in ${SPEC_TARGET[@]}; do
- filename="$rpms_dir/$target_cpu/\
+ if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" == "noarch" ]; then
+ filename="$rpms_dir/noarch/\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.noarch.rpm"
+ else
+ filename="$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
+ fi
[ -e "$filename" ] ||
notify.error $"package not found"": \`$filename'"
$tool -b $filename | sed "s,*.*/\(.*\),\1,"
@@ -3116,8 +3136,13 @@
if [ "$rpm_download_and_install" ]; then
local pck2install_list=""
for pck in ${SPEC_TARGET[@]}; do
- filename="$rpms_dir/$target_cpu/\
+ if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" == "noarch" ]; then
+ filename="$rpms_dir/noarch/\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.noarch.rpm"
+ else
+ filename="$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
+ fi
[[ -n "$rpm_install_noinstall_mask" &&
$filename =~ $rpm_install_noinstall_mask ]] && continue

View File

@ -0,0 +1,106 @@
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-12 12:13:49.374802087 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-12 12:22:00.533683095 +0200
@@ -893,31 +893,23 @@
# args:
# none
function target_cpu.set_and_check() {
- if [ "$target_cpu" ]; then
- # command '--arch' used by user to force the architecture
- # 'BuildArch' in the specfile takes precedence over cmdline
- if [[ -n "$SPEC_BUILDARCH" && \
- "$target_cpu" != "$SPEC_BUILDARCH" ]]; then
- notify.warning $"\
-command line architecture ignored, using:"\
-" \`${NOTE}$SPEC_BUILDARCH${NORM}' (BuildArch)"
- target_cpu="$SPEC_BUILDARCH"
- fi
- else
+ if [ ! "$target_cpu" ]; then
target_cpu="${SPEC_BUILDARCH:-$BUILD_ARCH}"
+ if [ "$target_cpu" == "noarch" ]; then
+ set -- ${arch_list[@]}
+ target_cpu=$1
+ fi
fi
notify.debug "target_cpu = $target_cpu"
- if [ "$target_cpu" != "noarch" ]; then
- # check if the 'target_cpu' is an allowed architecture
- local arch_list_curr bad_arch=1
- for arch_list_curr in ${arch_list[@]}; do
- [ "$arch_list_curr" = "$target_cpu" ] &&
- { let "bad_arch = 0"; break; }
- done
- [ "$bad_arch" = 1 ] &&
- notify.error $"unsupported architecture"": \`$target_cpu'"
- fi
+ # check if the 'target_cpu' is an allowed architecture
+ local arch_list_curr bad_arch=1
+ for arch_list_curr in ${arch_list[@]}; do
+ [ "$arch_list_curr" = "$target_cpu" ] &&
+ { let "bad_arch = 0"; break; }
+ done
+ [ "$bad_arch" = 1 ] &&
+ notify.error $"unsupported architecture"": \`$target_cpu'"
}
# function package.update()
@@ -2801,21 +2793,32 @@
if [ "$norpms" = "0" ]; then
let "i = 0"
for pck in ${SPEC_TARGET[@]}; do
- filename="\
-$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
- [ -e $rpms_dir/$target_cpu/$filename ] &&
- notify.note "\
- * ${NOTE}$filename${NORM}" ||
- notify.error $"\
-package not found"": \`$rpms_dir/$target_cpu/$filename'"
-
# copy noarch packages to all the repository set in the
# configuration variable `arch_noarch_upload[]'
- if [ "$target_cpu" = "noarch" ]; then
+ if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" = "noarch" ]; then
+ filename="\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.noarch.rpm"
+ [ -e $rpms_dir/noarch/$filename ] &&
+ notify.note "\
+ * ${NOTE}$filename${NORM}" ||
+ notify.error $"\
+package not found"": \`$rpms_dir/noarch/$filename'"
+
for upload_arch in \
${arch_noarch_upload[$ftp_server_upload_num]}; do
- currurl="\
+ if [ "$upload_arch" == "@arch@" ]; then
+ if [ "$target_cpu" != "noarch" ]; then
+ currurl="\
+$(repository.resolveURL "$upload_ftp_rpms_dir" "${target_cpu}")"
+ else
+ set -- ${arch_list[*]}
+ currurl="\
+$(repository.resolveURL "$upload_ftp_rpms_dir" "$1")"
+ fi
+ else
+ currurl="\
$(repository.resolveURL "$upload_ftp_rpms_dir" "$upload_arch")"
+ fi
notify.note "\
--> ""$upload_ftp_server${upload_ftp_port:+:$upload_ftp_port} :: $currurl"
@@ -2839,6 +2842,14 @@
[ $? -eq 0 ] || exit 1
done
else
+ filename="\
+$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm"
+ [ -e $rpms_dir/$target_cpu/$filename ] &&
+ notify.note "\
+ * ${NOTE}$filename${NORM}" ||
+ notify.error $"\
+package not found"": \`$rpms_dir/$target_cpu/$filename'"
+
currurl="\
$(repository.resolveURL "$upload_ftp_rpms_dir" "$target_cpu")"
notify.note "\

View File

@ -0,0 +1,75 @@
diff -Nru autospec-1.5.0.orig//autospec.spec.in autospec-1.5.0/autospec.spec.in
--- autospec-1.5.0.orig//autospec.spec.in 2010-07-11 20:58:17.000000000 +0200
+++ autospec-1.5.0/autospec.spec.in 2010-08-09 00:38:28.364052465 +0200
@@ -13,7 +13,7 @@
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://www.openmamba.org/packages.html
Source: autospec-%{version}.tar.bz2
-PreReq: rpm
+Requires(pre): rpm
Requires: cpio, coreutils, curl, findutils, grep, sed
Requires: /bin/mktemp
Requires: /usr/bin/getopt
diff -Nru autospec-1.5.0.orig//plugins/pck-update.in autospec-1.5.0/plugins/pck-update.in
--- autospec-1.5.0.orig//plugins/pck-update.in 2010-08-09 00:37:02.782052085 +0200
+++ autospec-1.5.0/plugins/pck-update.in 2010-08-09 00:39:07.550052253 +0200
@@ -758,7 +758,7 @@
notify.debug "rpm_macro_uninstallinfo check failed"; }
fi
if [ "$rpm_macro_installinfo_binary" ]; then
- grep -q "PreReq[ \t]*:[ \t]*${rpm_macro_installinfo_binary}" \
+ grep -q "Requires(post)[ \t]*:[ \t]*${rpm_macro_installinfo_binary}" \
$specfile ||
{ let "errors += 1"
notify.debug "rpm_macro_installinfo_binary check failed"; }
@@ -769,8 +769,8 @@
---------------------------------------
${NOTE}"$"Hint"":${NORM}
$([[ "$rpm_macro_installinfo_binary" ]] &&
- echo "PreReq: $rpm_macro_installinfo_binary" ||
- echo "PreReq: ${path_installinfo:-/sbin/install-info}")
+ echo "Requires(post):$rpm_macro_installinfo_binary" ||
+ echo "Requires(post):${path_installinfo:-/sbin/install-info}")
%post [<subpackage>]
$([[ "$rpm_macro_installinfo" ]] &&
diff -Nru autospec-1.5.0.orig//plugins/spec-create.in autospec-1.5.0/plugins/spec-create.in
--- autospec-1.5.0.orig//plugins/spec-create.in 2010-04-12 20:04:46.000000000 +0200
+++ autospec-1.5.0/plugins/spec-create.in 2010-08-09 00:39:27.935677047 +0200
@@ -782,8 +782,8 @@
License: ${spec_license:-$license_defvalue}"
if [ "$(specfile.infopages --exist)" = 1 ]; then
[ "$rpm_macro_installinfo_binary" ] &&
- echo "PreReq: ${rpm_macro_installinfo_binary}" ||
- echo "PreReq: ${path_installinfo:-/sbin/install-info}"
+ echo "Requires(post):${rpm_macro_installinfo_binary}" ||
+ echo "Requires(post):${path_installinfo:-/sbin/install-info}"
fi
[ "$spec_requires" ] && echo Requires: $spec_requires
[ "$spec_buildrequires" ] && echo BuildRequires: $spec_buildrequires
diff -Nru autospec-1.5.0.orig//tests/test01_pkgquality.in autospec-1.5.0/tests/test01_pkgquality.in
--- autospec-1.5.0.orig//tests/test01_pkgquality.in 2010-05-14 21:33:13.000000000 +0200
+++ autospec-1.5.0/tests/test01_pkgquality.in 2010-08-09 00:40:03.792692378 +0200
@@ -270,8 +270,8 @@
---------------------------------------
${NOTE}"$"Hint"":${NORM}
$([[ "$rpm_macro_installinfo_binary" ]] &&
- echo "PreReq: $rpm_macro_installinfo_binary" ||
- echo "PreReq: ${path_installinfo:-/sbin/install-info}")
+ echo "Requires(post):$rpm_macro_installinfo_binary" ||
+ echo "Requires(post):${path_installinfo:-/sbin/install-info}")
%post [<subpackage>]
$([[ "$rpm_macro_installinfo" ]] &&
diff -Nru autospec-1.5.0.orig//unmaintained/mbrowse.spec autospec-1.5.0/unmaintained/mbrowse.spec
--- autospec-1.5.0.orig//unmaintained/mbrowse.spec 2006-11-24 18:58:24.000000000 +0100
+++ autospec-1.5.0/unmaintained/mbrowse.spec 2010-08-09 00:40:35.354052403 +0200
@@ -59,7 +59,7 @@
#Patch3: http://www.awebsiteintheworld.org/awebpatch-%{version}.patch
BuildRequires: net-snmp-devel >= 4.2
BuildRequires: libopenssl-devel
-PreReq: %{__install_info}
+Requires(post):%{__install_info}
%if %with_gui
BuildRequires: libgtk1-devel >= 1.2.10
#BuildRequires: libglib2-devel >= 2.1.5

View File

@ -0,0 +1,13 @@
diff -Nru autospec-1.5.0.orig//autospec.conf.in autospec-1.5.0/autospec.conf.in
--- autospec-1.5.0.orig//autospec.conf.in 2010-07-17 23:09:02.000000000 +0200
+++ autospec-1.5.0/autospec.conf.in 2010-08-02 13:10:25.213473018 +0200
@@ -134,7 +134,8 @@
# Cmnd_Alias DISTRO_CMD = /usr/bin/apt-get, /bin/rpm
# %packager ALL = NOPASSWD: DISTRO_CMD
# (of course your user must belong to the `packager' group)
-rpm_download_and_install="sudo apt-get --quiet --yes install"
+#rpm_download_and_install="sudo apt-get --quiet --yes install"
+rpm_download_and_install="sudo smart install --yes"
rpm_install="sudo rpm -hUv"
rpm_install_force="sudo rpm -hUv --force --nodeps"

View File

@ -0,0 +1,12 @@
--- pck-update.orig 2008-10-11 15:55:53.000000000 +0200
+++ pck-update 2008-10-11 15:56:00.000000000 +0200
@@ -3608,8 +3608,7 @@
[ "$rpm_install_force" ] || notify.error "\
\`rpm_install_force': "$"unset in the configuration files"
notify.debug "$rpm_install_force $pck2install_list"
- $rpm_install_force $pck2install_list ||
- notify.error $"cannot install the new rpm packages"
+ $rpm_install_force $pck2install_list
else
[ "$rpm_install" ] || notify.error "\
\`rpm_install': "$"unset in the configuration files"

View File

@ -0,0 +1,12 @@
--- libapse.lib.orig 2008-10-10 01:39:44.000000000 +0200
+++ libapse.lib 2008-10-10 01:50:06.000000000 +0200
@@ -429,7 +429,8 @@
unset APSE_LAST_VERSION
if [ "$last_version" ]; then
- APSE_LAST_VERSION="$last_version"
+ last_version="${last_version/-/.}"
+ APSE_LAST_VERSION="${last_version}"
notify.note $"\
last version of \`${NOTE}$specname${NORM}' found:"" \
\`${NOTE}$last_version${NORM}'"

45
plugins/Makefile Normal file
View File

@ -0,0 +1,45 @@
# Makefile for autospec
# Copyright (C) 2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ..
include $(srcdir)/Makefile.env
pck_plugins := config-getvar pck-extract pck-update spec-create-old spec-create
pck_plugins_infiles := $(wildcard *.in)
all:
check: $(pck_plugins)
@for f in $(pck_plugins); do\
echo -n "checking $$f... ";\
bash -n $$f \
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
install: $(pck_plugins)
@$(INSTALL_DIR) $(DESTDIR)$(plugindir)
for f in $(pck_plugins); do\
$(INSTALL_SCRIPT) $${f} $(DESTDIR)$(plugindir)/$${f};\
done
uninstall:
for f in $(pck_plugins); do\
rm -f $(DESTDIR)$(plugindir)/$${f};\
done
clean:
rm -f $(patsubst %.in,%,$(pck_plugins_infiles))

234
plugins/config-getvar.in Normal file
View File

@ -0,0 +1,234 @@
#!/bin/bash
# config-getvar -- plugin for @package@
# Copyright (C) 2007,2008,2010,2011 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 3 ] &&
{ echo $"this script requires bash version 3 or better" >&2 && exit 1; }
me=(${0##*/} "@version@" "@date@")
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
# default values:
# - colorized output (disabled by default)
let "colorize = 0"
# - output verbosity
let "verbose = 1"
# load the configuration file(s)
[ -r @libdir@/libcfg.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libcfg.lib" 1>&2
exit 1; }
. @libdir@/libcfg.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="${me[0]}"; export TEXTDOMAIN
function copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function version() {
echo "\
${me[0]} ${me[1]}
Copyright (C) 2004-2008,2010,2011 Davide Madrisan <davide.madrisan@gmail.com>"
}
# $1: optional exit code (default is '1')
function usage() {
version
echo "\
"$"Print the value of a given configuration variable"".
"$"Usage"":
@frontend@ [-C <conf_file>] --eval=<var>
"$"where the above options mean"":
--eval "$"Print the value of the configuration variable <var>""
-C, --config "$"Use an alternate configuration file"" <conf_file>""
"$"Default files:"" ${default_cfg[0]}, ${default_cfg[1]}""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
-V, --version "$"Print version number, then exit""
-q, --quiet "$"Run in quiet mode""
-r, --colorize "$"Enable the colorized output""
-D, --debug "$"Run in debugging mode (very verbose output)""
"$"Samples"":
@frontend@ -q -C ${default_cfg[0]} --eval=\"logging_dir\"
"$"Report bugs to <davide.madrisan@gmail.com>."
exit ${1:-1}
}
case $1 in
--autospec-args-file*)
if [[ "$1" =~ = ]]; then
argsfile=`echo $1 | sed 's/^--autospec-args-file=//'`
else
argsfile=$2
fi
[ -r "$argsfile" ] || notify.error $"cannot read"": \`$argsfile'"
. $argsfile && rm -f $argsfile
;;
esac
for arg in $@; do
case $arg in
-h|--help) usage 0 ;;
-V|--version) version; echo; copying; exit 0 ;;
esac
done
exec_options=`LANG=C getopt \
-o C:DqrhV \
--long eval:,config:,\
debug,quiet,colorize,help,version,\
frontend_opts: \
-n "$me" -- "$@"`
[ $? = 0 ] || exit 1
notify.debug "[ ${0} ${exec_options} ]\n"
eval set -- "$exec_options"
while :; do
case $1 in
-C|--config)
cfg_file=$2; shift ;;
--eval)
autospecvar="$2"; shift ;;
-D|--debug)
let "verbose = 2" ;;
-q|--quiet)
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
-h|--help)
usage 0 ;;
-V|--version)
version; echo; copying; exit 0 ;;
--) shift; break ;;
*) notify.error $"unrecognized option"" -- \`$1'" ;;
esac
shift
done
for arg in $@; do
[[ -z "$s_rpm_pck" ]] && s_rpm_pck=$arg ||
notify.error $"unrecognized option"" -- \`$arg'"
done
[ "$colorize" = "1" ] && notify.enable_colors
# config.getvar()
# Parameters:
# $1 : the configuration file where to look at
# $2 : the configuration variable to expand
# Description:
# Expand the configuration variable `$2' looking in the file `$1'
function config.getvar() {
notify.debug "[ ${0}${exec_options} ]\n"
local cfg_file="$1"
local autospecvar="$2"
local cfg_file_lst
if [ "$cfg_file" ]; then
[ -r $cfg_file ] ||
notify.error $"configuration file not found"" -- \`$cfg_file'"
cfg_file_lst="$cfg_file"
else
cfg_file_lst="${default_cfg[*]}"
fi
notify.debug "cfg_file_lst = \"$cfg_file_lst\""
unset value autospecvar_val autospecvar_file autospecvar_sed
autospecvar_sed=$(\
echo "$autospecvar" | sed 's,\[,\\[,g;s,\],\\],g')
for f in $cfg_file_lst; do
[ -r $f ] || continue
confvar_1stline=$(\
sed -n "/^[ \t]*$autospecvar_sed[[]*[0-9]*[]]*=/p" $f)
if [[ "$confvar_1stline" ]]; then
autospecvar_file="$f"
notify.debug "variable \`$autospecvar' found in \`$f'"
notify.debug "confvar_1stline = \`$confvar_1stline'"
[ "$verbose" = 0 ] || notify.note "#[$autospecvar_file]"
confvar_1stline=$(\
sed -n "/^[ \t]*$autospecvar_sed[[]*[0-9]*[]]*=/p" $autospecvar_file)
notify.debug "confvar_1stline = \`$confvar_1stline'"
case "$confvar_1stline" in
*[\[0-9*\]]=*)
# an entry like: ftp_rw_srpms_dir[0]="/devel/SRPMS"
case "$autospecvar" in
*[\[0-9*\]])
sed -n "/^$autospecvar_sed=/{s|.*|&;|p}" \
$autospecvar_file |
while read line; do notify.note "$line"; done
;;
*) sed -n "/^$autospecvar_sed\[[0-9*]\]=/{s|.*|&;|p}" \
$autospecvar_file |
while read line; do notify.note "$line"; done
;;
esac
;;
*=\"*\"|*=%*|*=[0-9a-zA-Z]*|*=\$*|*=\(*\))
# entries like:
# - rpm_macro_make="%make"
# - rpm_macro_make=%make
# - ftp_rw_rpms_dir[0]="/devel/RPMS"
# - arch_list="i586 ppc"
notify.note "${confvar_1stline};"
;;
*=\(*)
# a variable like:
# rpm_approved_licenses=(\
# ... <list of entries, one per line>
sed -e '/./{H;$!d;}' -e "x;/$autospecvar_sed=(/!d;" \
$autospecvar_file |
while read line; do
case "$line" in
\#*|"") ;;
*\)) notify.note "${line};" ;;
*) notify.note "$line" ;;
esac
done
;;
*=\"\\)
# a variable like:
# format_extra_rules="\
sed -e '/./{H;$!d;}' -e "x;/$autospecvar_sed=\"/!d;" \
$autospecvar_file |
while read line; do
case "$line" in
\#*|"") ;;
*\") notify.note "${line};" ;;
*) notify.note "$line" ;;
esac
done
;;
*) notify.error $"(bug)"" -- $FUNCNAME: "$"unknown variable type"
;;
esac
fi
done
}
config.getvar "$cfg_file" "$autospecvar"

270
plugins/pck-extract.in Normal file
View File

@ -0,0 +1,270 @@
#!/bin/bash
# pck-extract -- plugin for @package@
# Copyright (C) 2004-2010 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 3 ] &&
{ echo $"this script requires bash version 3 or better" >&2 && exit 1; }
me=(${0##*/} "@version@" "@date@")
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
# default values:
# - colorized output (disabled by default)
let "colorize = 0"
# - output verbosity
let "verbose = 1"
# load the configuration file(s)
[ -r @libdir@/libcfg.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libcfg.lib" 1>&2
exit 1; }
. @libdir@/libcfg.lib
[ -r @libdir@/libnetwork.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libnetwork.lib" 1>&2
exit 1; }
. @libdir@/libnetwork.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="${me[0]}"; export TEXTDOMAIN
function copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function version() {
echo "\
${me[0]} ${me[1]}
Copyright (C) 2004-2010 Davide Madrisan <davide.madrisan@gmail.com>"
}
# $1: optional exit code (default is '1')
function usage() {
version
echo "\
"$"Extract a given file or list of files from a srpm archive"".
"$"Usage"":
@frontend@ -x -F <file(s)> [--destdir=<dir>] <srpm_pck>
"$"where the above options mean"":
-x, --extract "$"Extract from the srpm package <srpm_pck>...""
-F, --files "$"...the specified file or list of files <file(s)>""
--destdir "$"Save extracted files in the directory <dir>""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
-V, --version "$"Print version number, then exit""
-q, --quiet "$"Run in quiet mode""
-r, --colorize "$"Enable the colorized output""
-D, --debug "$"Run in debugging mode (very verbose output)""
"$"Samples"":
@frontend@ -x @package@-@version@-1mamba.src.rpm -F \\*.spec --destdir=/tmp/specs
"$"Report bugs to <davide.madrisan@gmail.com>."
exit ${1:-1}
}
case $1 in
--autospec-args-file*)
if [[ "$1" =~ = ]]; then
argsfile=`echo $1 | sed 's/^--autospec-args-file=//'`
else
argsfile=$2
fi
[ -r "$argsfile" ] || notify.error $"cannot read"": \`$argsfile'"
. $argsfile && rm -f $argsfile
;;
esac
for arg in $@; do
case $arg in
-h|--help) usage 0 ;;
-V|--version) version; echo; copying; exit 0 ;;
esac
done
exec_options=`LANG=C getopt \
-o xF:DqrhV \
--long \
extract,files:,destdir:,\
debug,quiet,colorize,help,version,\
frontend_opts: \
-n "$me" -- "$@"`
[ $? = 0 ] || exit 1
notify.debug "[ ${0} ${exec_options} ]\n"
eval set -- "$exec_options"
while :; do
case $1 in
-x|--extract) ;;
-F|--files)
filelst="$2"; shift ;;
--destdir)
destdir="$2"; shift ;;
-D|--debug)
let "verbose = 2" ;;
-q|--quiet)
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
-h|--help)
usage 0 ;;
-V|--version)
version; echo; copying; exit 0 ;;
--) shift; break ;;
*) notify.error $"unrecognized option"" -- \`$1'" ;;
esac
shift
done
for arg in $@; do
[[ -z "$s_rpm_pck" ]] && s_rpm_pck=$arg ||
notify.error $"unrecognized option"" -- \`$arg'"
done
[ "$colorize" = "1" ] && notify.enable_colors
# s_rpm_pck : the name of the srpm package (local or remote)
# (i.e. /usr/src/RPM/SRPMS/automake-1.9-1qilnx.src.rpm)
# filelst : list of file to extract (default is '*.spec', that is the specfile)
# destdir : the directory where to extract files (current directory if unset)
#
# Extract the specified file(s) `filelst' (default = all files) from the rpm or srpm
# archive `s_rpm_pck' to the optional directory `destdir'.
[ -z "$filelst" ] && filelst='*'
[ -z "$destdir" ] && destdir='.'
notify.note "[${NOTE}$s_rpm_pck${NORM}]"
# check if all the needed tools are available
for tool in bunzip2 cpio gunzip mktemp rpm2cpio; do
[ "$(type -p $tool)" ] ||
notify.error $"utility not found"": \`$tool'"
done
tmpcpiodir=$(mktemp -q -d -t $me.XXXXXXXX)
[ $? -eq 0 ] &&
trap "rm -fr $tmpcpiodir" 0 1 2 3 6 7 9 13 15 ||
notify.error $"can't create temporary files"
notify.debug "$FUNCNAME: tmpcpiodir = $tmpcpiodir"
#local s_rpm_pck_name
case "$s_rpm_pck" in
http://*\.src\.*|http://*\.nosrc\.*|ftp://*\.src\.*|ftp://*\.nosrc\.*)
s_rpm_pck_name="${s_rpm_pck##*/}"
notify.debug "$FUNCNAME: s_rpm_pck_name = $s_rpm_pck_name"
curl.download \
--options "$curl_options" \
${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \
--exit-on-err --destdir="$tmpcpiodir" "$s_rpm_pck"
s_rpm_pck="$tmpcpiodir/$s_rpm_pck_name"
;;
*\.src\.*|*\.nosrc\.*)
s_rpm_pck_name="$s_rpm_pck"
notify.debug "$FUNCNAME: s_rpm_pck_name = $s_rpm_pck_name"
[[ -e "$s_rpm_pck" ]] ||
notify.error $"cannot find:"" \`$s_rpm_pck'"
;;
*) # FIXME : add support for RPMS packages if someone will ask for
notify.error "\`$s_rpm_pck': "$"not a srpm package" ;;
esac
mkdir -p $destdir 2>/dev/null || notify.error $"cannot create \`$destdir'"
#local errcode
#local \
tmpcpiopck="srpm_pck.cpio"
notify.debug "\
$FUNCNAME: converting the rpm package into a cpio archive..."
rpm2cpio $s_rpm_pck > $tmpcpiodir/$tmpcpiopck
let "errcode = $?"
[ "$errcode" = 0 ] ||
{ rm -fr $tmpcpiodir
notify.debug "$FUNCNAME: exit code of rpm2cpio = \`$errcode'"
notify.error $"can't save extracted files to \`$destdir'"; }
notify.debug "\
$FUNCNAME: extracting files from the cpio archive..."
pushd $tmpcpiodir &>/dev/null
cpio --quiet --extract --preserve-modification-time \
< $tmpcpiodir/$tmpcpiopck
let "errcode = $?"
[ "$errcode" = 0 ] ||
{ rm -fr $tmpcpiodir
notify.debug "$FUNCNAME: exit code of cpio = \`$errcode'"
notify.error $"can't save extracted files to \`$destdir'"; }
rm -f $tmpcpiodir/$tmpcpiopck
#notify.debug "\
#$FUNCNAME: extracting files from the srpm archive..."
#
#rpm2cpio $s_rpm_pck 2>/dev/null | \
#cpio --quiet --extract $filelst &>/dev/null
#[ $? -ne 0 ] &&
# { popd &>/dev/null
# notify.error $"can't save extracted files to \`$destdir'"; }
popd &>/dev/null
#local fname
for f in $tmpcpiodir/${filelst:-*}; do
fname=${f##*/}
notify.debug "$FUNCNAME: fname = \"$fname\""
case $fname in
$s_rpm_pck_name)
;;
*\.diff.bz2|*\.patch.bz2)
notify.debug "$FUNCNAME: decompressing the patch..."
bunzip2 $f &>/dev/null
[ $? -eq 0 ] ||
{ rm -fr $tmpcpiodir
notify.warning $"can't decompress the file"" \`$f'"; }
notify.note " * ${NOTE}$destdir/${fname/\.bz2/}${NORM}"
cp -pf ${f/\.bz2/} $destdir/${fname/\.bz2/} &>/dev/null
;;
*\.diff.gz|*\.patch.gz)
notify.debug "$FUNCNAME: decompressing the patch..."
gunzip $f &>/dev/null
[ $? -eq 0 ] ||
{ rm -fr $tmpcpiodir
notify.warning $"can't decompress the file"" \`$f'"; }
notify.note " * ${NOTE}$destdir/${fname/\.gz/}${NORM}"
cp -pf ${f/\.gz/} $destdir/${fname/\.gz/} &>/dev/null
;;
*)
notify.note " * ${NOTE}$destdir/$fname${NORM}"
cp -pf $f $destdir/$fname &>/dev/null
;;
esac
[ $? -eq 0 ] ||
{ rm -fr $tmpcpiodir
notify.error $"can't save files to \`$destdir'"; }
done
rm -fr $tmpcpiodir

3198
plugins/pck-update.in Normal file

File diff suppressed because it is too large Load Diff

1507
plugins/spec-create-old.in Normal file

File diff suppressed because it is too large Load Diff

770
plugins/spec-create.in Normal file
View File

@ -0,0 +1,770 @@
#!/bin/bash
# pck-create -- plugin for @package@
# Copyright (C) 2004-2011 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 3 ] &&
{ echo $"this script requires bash version 3 or better" >&2 && exit 1; }
me=(${0##*/} "@version@" "@date@")
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
[ -r @libdir@/libnetwork.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libnetwork.lib" 1>&2
exit 1; }
. @libdir@/libnetwork.lib
# set default variables
# colorized output (disabled by default)
let "colorize = 0"
# output verbosity
let "verbose = 1"
spec_type=standard
spec_first_release=1
spec_run_ldconfig="/sbin/ldconfig"
spec_changelog_date="$(LC_ALL="C" date "+%a %b %d %Y")"
spec_changelog_comment="package created by @package@"
spec_default_summary="..."
spec_default_group="..."
spec_default_url="..."
spec_default_license="..."
spec_default_source="..."
spec_default_description="..."
spec_default_description_devel="..."
spec_setup_macro=
spec_cmd_configure_autotools="%configure"
spec_cmd_make_autotools="%make"
spec_cmd_makeinstall_autotools="%makeinstall"
spec_cmd_configure_cmake="%cmake -d build"
spec_cmd_make_cmake="%make"
spec_cmd_makeinstall_cmake="%makeinstall -C build"
spec_cmd_configure_default=""
spec_cmd_make_default=""
spec_cmd_makeinstall_default=""
[ "$perl_Makefile_generator" ] || perl_Makefile_generator="Makefile.PL"
# load the configuration file(s)
[ -r @libdir@/libcfg.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libcfg.lib" 1>&2
exit 1; }
. @libdir@/libcfg.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="${me[0]}"; export TEXTDOMAIN
function copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function version() {
echo "\
${me[0]} ${me[1]}
Copyright (C) 2004-2011 Davide Madrisan <davide.madrisan@gmail.com>"
}
# $1: optional exit code (default is '1')
function usage() {
version
echo "\
"$"Try to create a specfile for the specified source archive"".
"$"Usage"":
@frontend@ -s <source-archive> [-n <name>] [-v <ver>] [-t <type>] [-o <outfile>]
"$"where the above options mean"":
-s, --source "$"Try to create a specfile for the specified source archive""
-n, --pck-name "$"Name of the package (default: taken from <source-archive> name)""
-v, --pck-version "$"Version of the package (default: taken from <source-archive> name)""
-t, --type "$"Typology of the specfile to be created""
standard : "$"standard specfile (default)""
gnome : "$"specfile for gnome packages""
kde3 : "$"specfile for kde3 packages""
kde4 : "$"specfile for kde4 packages""
library : "$"specfile for common library packages""
perl : "$"specfile for single-package perl modules""
python : "$"specfile for python modules""
standard-daemon : "$"standard specfile for system/network services""
-o, --output "$"Redirect the output to the file <outfile>""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
-V, --version "$"Print version number, then exit""
-q, --quiet "$"Run in quiet mode""
-r, --colorize "$"Enable the colorized output""
-D, --debug "$"Run in debugging mode (very verbose output)""
"$"Samples"":
@frontend@ -s ~/software/@package@-@version@.tar.bz2 -t standard -o @package@.spec
@frontend@ -s http://ftp.qilinux.it/devel/tools/@package@/@package@-@version@.tar.bz2
"$"Report bugs to <davide.madrisan@gmail.com>."
exit ${1:-1}
}
case $1 in
--autospec-args-file*)
if [[ "$1" =~ = ]]; then
argsfile=`echo $1 | sed 's/^--autospec-args-file=//'`
else
argsfile=$2
fi
[ -r "$argsfile" ] || notify.error $"cannot read"": \`$argsfile'"
. $argsfile && rm -f $argsfile
;;
esac
for arg in $@; do
case $arg in
-h|--help) usage 0 ;;
-V|--version) version; echo; copying; exit 0 ;;
esac
done
# the user configuration file for @package@ is required
config.check4user
exec_options=`LANG=C getopt \
-o s:n:v:t:o:DqrhV \
--long \
source:,pck-name:,pck-version:,type:,output:,\
debug,quiet,colorize,help,version,\
frontend_opts: \
-n "$me" -- "$@"`
[ $? = 0 ] || exit 1
notify.debug "[ ${0} ${exec_options} ]\n"
eval set -- "$exec_options"
while :; do
case $1 in
-s|--source)
[ "$2" = "--help" ] && usage 0
[ "$2" = "-h" ] && usage 0
pck_tarball=$2; shift
;;
-n|--pck-name)
pck_name=$2; shift ;;
-v|--pck-version)
shift; pck_version=$1 ;;
-t|--type)
spec_type=$2; shift ;;
-o|--output)
outfile=$2; shift ;;
-D|--debug)
let "verbose = 2" ;;
-q|--quiet)
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
-h|--help)
usage 0 ;;
-V|--version)
version; echo; copying; exit 0 ;;
--) shift; break ;;
*) notify.error $"unrecognized option"" -- \`$1'" ;;
esac
shift
done
for arg in $@; do
notify.error $"unrecognized option"" -- \`$arg'"
done
[ "$colorize" = "1" ] && notify.enable_colors
function specfile.ckeck_defvalues() {
# $1: name of the specfile
local specfile="$1" currvalue
check_values=(
"Summary" spec_default_summary
"Group" spec_default_group
"URL" spec_default_url
"Source" spec_default_source
"License" spec_default_license
"%description" spec_default_description
"%description devel" spec_default_description_devel
)
for i in `seq 1 1 $(( ${#check_values[@]} / 2 ))`; do
id="${check_values[($i-1)*2]}"
value="${check_values[($i-1)*2+1]}"
case "$id" in
# when id begins by a '%' character, the two lines below the id must
# be taken into account (three lines: the line containing the id, the
# following one and the following (blank) line)
%*) sed -n "/^$id$/,/^$/p" $specfile | sed 3q | grep -q "${!value}"
[ $? -eq 0 ] && notify.warning $"\
remember to modify the value for \`${NOTE}$id${NORM}'" ;;
*) currvalue="\
$(sed -n "/%description/q;{/^[ \t]*$id[ \t]*:[ \t]*/{s,.*:[ \t]*,,p}}" $specfile)"
notify.debug "[[ \"$currvalue\" =~ \"${!value}\" ]]"
[[ "$currvalue" =~ "${!value}" ]] && notify.warning $"\
remember to modify the value for \`${NOTE}$id${NORM}'" ;;
esac
done
}
function template.expand() {
local OPTIONS=`LANG=C getopt \
-o t:T:n:v:s:l:S:d:b: \
--long template:,type:,pckname:,pckversion:,setupmacro:,summary:,license:,\
source:,standard-docs:,build-technology:,\
i18n:,icons-mimetypes:,\
infopages:,manpages:,\
pck-apidocs:,pck-tools:,\
shared-libraries:,\
-n "${0}" -- "$@"`
[ $? = 0 ] || exit 1
notify.debug "$FUNCNAME: ${OPTIONS}"
eval set -- "${OPTIONS}"
local templatefile spec_type
local pck_name pck_version
local spec_setup_macro
local spec_summary="$spec_default_summary"
local spec_license="$spec_default_license"
local standard_docs
local build_technology
local i18n="0"
local icons_mimetypes="0"
local infopages="0"
local manpages="0"
local pck_apidocs="0"
local pck_tools="0"
local shared_libraries="0"
while :; do
case $1 in
-t|--template)
templatefile=$2; shift ;;
-T|--type)
spec_type=$2; shift ;;
-n|--pckname)
pck_name=$2; shift ;;
-v|--pckversion)
pck_version=$2; shift ;;
-s|--setupmacro)
spec_setup_macro="$2"; shift ;;
--summary)
spec_summary="$2"; shift ;;
-l|--license)
spec_license="$2"; shift ;;
-S|--source)
spec_source="$2"; shift ;;
-d|--standard-docs)
standard_docs="$2"; shift ;;
-b|--build-technology)
build_technology="$2"; shift ;;
--i18n)
i18n="$2"; shift ;;
--icons-mimetypes)
icons_mimetypes="$2"; shift ;;
--infopages)
infopages="$2"; shift ;;
--manpages)
manpages="$2"; shift ;;
--pck-apidocs)
pck_apidocs="$2"; shift ;;
--pck-tools)
pck_tools="$2"; shift ;;
--shared-libraries)
shared_libraries="$2"; shift ;;
--) shift; break ;;
*) notify.error $"unrecognized option"" -- \`$1'" ;;
esac
shift
done
notify.debug "$FUNCNAME: build_technology = $build_technology"
local spec_cmd_configure
local spec_cmd_make
local spec_cmd_makeinstall
case "$build_technology" in
cmake)
spec_cmd_configure="$spec_cmd_configure_cmake"
spec_cmd_make="$spec_cmd_make_cmake"
spec_cmd_makeinstall="$spec_cmd_makeinstall_cmake"
;;
autotools)
spec_cmd_configure="$spec_cmd_configure_autotools"
spec_cmd_make="$spec_cmd_make_autotools"
spec_cmd_makeinstall="$spec_cmd_makeinstall_autotools"
;;
unknown)
notify.warning $"unknown build techonology"
spec_cmd_configure="$spec_cmd_configure_default"
spec_cmd_make="$spec_cmd_make_default"
spec_cmd_makeinstall="$spec_cmd_makeinstall_default"
;;
esac
notify.debug "$FUNCNAME: spec_cmd_configure = \"$spec_cmd_configure\""
notify.debug "$FUNCNAME: spec_cmd_make = \"$spec_cmd_make\""
notify.debug "$FUNCNAME: spec_cmd_makeinstall = \"$spec_cmd_makeinstall\""
[ -r "$templatefile" ] || notify.error $"file not found"": $templatefile"
local currvar line skipline=0
while read line; do
# FIXME: this code does not support nested conditional statements
case "$line" in
@if:*)
currvar="$(echo "$line" | sed "s,@if:\([^ \t]*\).*,\1,")"
[ "${!currvar}" = 1 ] || skipline=1
#echo "@if[$currvar]"
#unset currvar
continue
;;
@else:*)
#currvar="$(echo "$line" | sed "s,@if:\([^ \t]*'http://search.cpan.org/CPAN/authors/id/K/KB/KBAUCOM/Term-Animation-%{version}.tar.gz'\).*,\1,")"
[ "$skipline" = 0 ] && skipline=1 || skipline=0
;;
@fi:*)
#currvar="$(echo "$line" | sed "s,@fi:\([^ \t]*\).*,\1,")"
skipline=0
continue
;;
*) [ "$skipline" = 1 ] || echo "$line" | sed "\
s,@DISTRO@,${DISTRO:-?DISTRO?},
s,@DISTRO_rpm@,${DISTRO_rpm:-?DISTRO_rpm?},
s,@VENDOR@,${VENDOR:-?VENDOR?},
s,@packager_fullname@,${packager_fullname:-?packager_fullname?},
s,@packager_email@,${packager_email:-?packager_email?},
s,@rpm_default_buildroot@,${rpm_default_buildroot:-?rpm_default_buildroot?},
s,@pck_name@,$pck_name,
s,@pck_version@,$pck_version,
s,@spec_first_release@,${spec_first_release:-1},
s,@spec_run_ldconfig@,$spec_run_ldconfig,
s,^\(%setup.*\),${spec_setup_macro},
/^[ \t]*Summary[ \t]*:[ \t]*\.\.\..*$/{
s,\(^[ \t]*Summary[ \t]*:[ \t]*\).*,\1${spec_summary},}
/^[ \t]*License[ \t]*:[ \t]*\.\.\.$/{
s,\(^[ \t]*License[ \t]*:[ \t]*\).*,\1${spec_license},}
s,^\([ \t]*Source[ \t]*:[ \t]*\).*,\1${spec_source},
s,@configure@,$spec_cmd_configure,
s,@make@,$spec_cmd_make,
s,@makeinstall@,$spec_cmd_makeinstall,
s,@standard_docs@,${standard_docs:+%doc $standard_docs},
s,@spec_changelog_date@,$spec_changelog_date,
s,@spec_changelog_comment@,$spec_changelog_comment,
"
#/$spec_i18n/{ # if spec_i18n
# s,@i18n@\([^@]*\)@.*,\1,;be;} #select 1st arg
#:e s,@i18n@[^@]*@\([^@]*\)[@]*,\1, #select 2nd arg
;;
esac
done < $templatefile | \
sed '/^$/{n;/^$/d}' # remove duplicate blank lines
}
# specfile.create()
# Parameters:
# $1 : try to create a specfile from this tarball
# $2 : package name
# $3 : package version
# $4 : package tipology (template)
# $5 : output file
# Description:
# Create an initial specfile to help packaging activities
#
function specfile.create() {
notify.debug "[ ${0}${exec_options} ]\n"
# check if all the needed tools are available
# note: uncompress has been removed from the mandatory list
for tool in chmod find grep mktemp sed bunzip2 gunzip unzip; do
[ "$(type -p $tool)" ] ||
notify.error $"utility not found"": \`$tool'"
done
local spec_type="$1"
# collect informations from the tarball name and the source files
# 1. pck_tarball, pck_name , pck_version
# 2. pck_rootdir (where the package has been decompressed) --> pck_rootdir_4spec
# 'pck_tarball' = absolute path of '$1'
local pck_tarball
case "$2" in
http://*|https://*|ftp://*)
pck_tarball="${2##*/}"
spec_source="$2"
curl.download \
--options "$curl_options" \
${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \
--exit-on-err --destdir="$source_dir" "$spec_source"
pck_tarball=$source_dir/$pck_tarball
;;
*://*)
notify.error $"unsupported protocol"": \`${2//\:*}'"
;;
/*) pck_tarball="$2" ;;
*) pck_tarball="$(pwd)/$2" ;;
esac
notify.debug "$FUNCNAME: pck_tarball = $pck_tarball"
notify.debug "$FUNCNAME: spec_source = $spec_source"
[ "$pck_tarball" ] || notify.error $"missing tarball name"
[ -e $pck_tarball ] ||
notify.error $"cannot find the package $pck_tarball"
# get the package name from the tarball name
local pck_name=${3:-`echo $2 | sed -n "\
s/.*\/// # remove directory name, if any
s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
/-[0-9]*/{s/-[0-9].*//p;q} # <pck_name>-<pck_ver>
/[^-\.][0-9]\./{s/\(.*[^-\.]\)[0-9]\..*/\1/p;q} # <pck_name><pck_ver>
# <pck_name> (no version, but <pck_name> can end with numbers)
/^[^0-9]*[0-9]*$/p"`}
notify.debug "pck_name = \"$pck_name\""
[ "$pck_name" ] ||
notify.error $"cannot get the package name, use the \`-n' option"
[[ "${pck_newver//[0-9\.]/}" ]] &&
notify.error $"invalid version number"" -- \`$pck_newver'"
local pck_version=${4:-`echo $2 | sed -n "\
/[0-9]/!q # return nothing if no number is found in the package name
s,.*/,, # remove directory name, if any
s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
/-[0-9]*/{s/.*-\([0-9]*.*\)/\1/p;q} # <pck_name>-<pck_ver>
/[^-\.][0-9]\./{s/.*[^-\.]\([0-9]\..*\)/\1/p;q} # <pck_name><pck_ver>
# <pck_name> (no version, but <pck_name> can end with numbers)
/^[^0-9]*[0-9]*$/q"`}
notify.debug "$FUNCNAME: pck_version = \"$pck_version\""
[ "$pck_version" ] ||
notify.error $"cannot get the package version, use the \`-v' option"
local outfile="$5"
if [ "$outfile" ]; then
notify.debug "$FUNCNAME: output file"": ${NOTE}$outfile${NORM}"
> $outfile || notify.error $"can't create output file"" $outfile"
# do not chmod a non-regular file (for instance /dev/null)
[ -f "$outfile" ] && chmod ${rpm_specfile_mode:-644} $outfile
fi
notify.note "${NOTE}"$"generating specfile""${NORM}""...""
* "$"source"": ${NOTE}$pck_tarball${NORM}""
* "$"mode"": ${NOTE}$spec_type${NORM}"
case "$spec_type" in
library)
[[ "$pck_name" =~ $library_name_structure ]] || notify.error $"\
libraries must have this name structure (use \`-n'):"" \
\`$library_name_structure'"
;;
perl)
[[ "$pck_name" =~ $perl_module_name_structure ]] || notify.error $"\
perl modules must have this name structure (use \`-n'):"" \
\`$perl_module_name_structure'"
;;
python)
[[ "$pck_name" =~ $python_module_name_structure ]] || notify.error $"\
python modules must have this name structure (use \`-n'):"" \
\`$python_module_name_structure'"
;;
esac
# link fd#3 with stdout and redirect stdout to the log file
[ "$outfile" ] && { exec 3<&1; exec 1>>$outfile; }
local tmpdir=`mktemp -q -d -t $me.XXXXXXXX`
[ $? -eq 0 ] ||
notify.error $"can't create temporary directory"
# decompress the tarball in the 'tmpdir' directory
cp -f $pck_tarball $tmpdir
pushd $tmpdir >/dev/null
case $pck_tarball in
*.tar.gz|*.tgz)
gunzip -c $pck_tarball | tar xf - ;;
*.tar.bz2|*.tbz2)
bunzip2 -c $pck_tarball | tar xf - ;;
*.tar.Z)
[ "$(type -p uncompress)" ] ||
notify.error $"utility not found"": \`uncompress'"
uncompress -c $pck_tarball | tar xf - ;;
*.shar.gz)
gunzip -c $pck_tarball | unshar ;;
*.zip)
unzip -q $pck_tarball ;;
*.tar.xz|*.tar.lzma)
[ "$(type -p xz)" ] ||
notify.error $"utility not found"": \`xz'"
xz -d --stdout $pck_tarball | tar xf - ;;
*.tar.lz)
[ "$(type -p lzip)" ] ||
notify.error $"utility not found"": \`lzip'"
lzip -cd $pck_tarball | tar -xf - ;;
*.tar.7z)
[ "$(type -p 7za)" ] ||
notify.error $"utility not found"": \`7za'"
7za x -bd $pck_tarball >/dev/null | tar xf - ;;
*.7z)
[ "$(type -p 7za)" ] ||
notify.error $"utility not found"": \`7za'"
7za x -bd $pck_tarball >/dev/null ;;
*.jar)
[ "$(type -p jar)" ] ||
notify.error $"utility not found"": \`jar'"
jar -xf $pck_tarball >/dev/null ;;
*) notify.warning $"unsupported package compression method" ;;
esac
popd >/dev/null
rm -f $tmpdir/${pck_tarball##*/}
local pck_rootdir_dirs=(`\
LANG=C find $tmpdir -mindepth 1 -maxdepth 1 -type d -printf "%f "`)
notify.debug "$FUNCNAME: pck_rootdir_dirs = \"$pck_rootdir_dirs\""
local pck_rootdir_files=(`\
LANG=C find $tmpdir -mindepth 1 -maxdepth 1 -type f -printf "%f "`)
notify.debug "$FUNCNAME: pck_rootdir_files = \"$pck_rootdir_files\""
# 0. set 'spec_setup_macro'
local pck_rootdir local pck_rootdir_4spec spec_setup_macro
if [[ -n "$pck_rootdir_files" || \
( -z "$pck_rootdir_dirs" && -z "$pck_rootdir_files" ) ]]; then
# detected a package without a root directory
pck_rootdir=""
pck_rootdir_4spec="-c %{name}-%{version}"
spec_setup_macro="%setup -q $pck_rootdir_4spec"
else
pck_rootdir="$pck_rootdir_dirs"
pck_rootdir_4spec=`echo $pck_rootdir | \
sed "s/$pck_name/%{name}/;s/$pck_version/%{version}/"`
if [ "$pck_rootdir_4spec" = "%{name}-%{version}" ]; then
spec_setup_macro="%setup -q"
elif [ "$pck_rootdir_4spec" = "-c %{name}-%{version}" ]; then
spec_setup_macro="%setup -q $pck_rootdir_4spec"
else
spec_setup_macro="%setup -q -n $pck_rootdir_4spec"
fi
fi
notify.debug "$FUNCNAME: pck_rootdir = \"$pck_rootdir\""
notify.debug "$FUNCNAME: pck_rootdir_4spec = \"$pck_rootdir_4spec\""
notify.debug "$FUNCNAME: spec_setup_macro = \"$spec_setup_macro\""
# 1. preliminaries checks
case "$spec_type" in perl) ;;
*) [[ -e $tmpdir/$pck_rootdir/$perl_Makefile_generator ||
-e $tmpdir/$pck_rootdir/Build.PL ]] && notify.warning $"\
looks like a perl package (use \`-t perl' if this is true)" ;;
esac
case "$spec_type" in python) ;;
*) [[ -e $tmpdir/$pck_rootdir/setup.py ]] && notify.warning $"\
looks like a python module (use \`-t python' if this is true)" ;;
esac
# 2. set 'spec_summary'
local spec_summary="$spec_default_summary"
local perl_pckname_from_makefile=""
case "$spec_type" in perl)
if [ -e $tmpdir/$pck_rootdir/Makefile.PL ]; then
# look for the variable `NAME' in Makefile.PL inside the
# 'WriteMakefile(' ... ')' block
perl_pckname_from_makefile=$(sed -n "\
/^[ \t]*WriteMakefile(/,/^)/{#
/^[ \t]*[']NAME['][ \t]*=>/{#
s|.*=>[ \t]*['\"]\(.*\)['\"].*|\1|;p}}" \
$tmpdir/$pck_rootdir/Makefile.PL)
# [ "$perl_pckname_from_makefile" ] ||
# perl_pckname_from_makefile=$(sed -n "\
#/name/{s,^[ \t]*name[ \t]*['\"]*\([a-zA-Z]*\)['\"]*.*,\1,p}" \
# $tmpdir/$pck_rootdir/Makefile.PL)
fi
[ -n "$perl_pckname_from_makefile" ] &&
spec_summary="$perl_pckname_from_makefile - ..."
esac
# 3. set 'spec_license'
case "$spec_type" in perl)
spec_license="${perl_License_default:-$spec_default_license}"
esac
# find for package license info
# FIXME: currently GNU GPL, LGPL, and W3C licenses are supported
local spec_license="$spec_default_license"
if [[ -e $tmpdir/$pck_rootdir/COPYING ]]; then
[[ `grep -c "[ ]*GNU GENERAL PUBLIC LICENSE[ ]*" \
$tmpdir/$pck_rootdir/COPYING` -eq 0 ]] || spec_license="GPL"
[[ `grep -c "[ ]*GNU LIBRARY GENERAL PUBLIC LICENSE[ ]*" \
$tmpdir/$pck_rootdir/COPYING` -eq 0 ]] || spec_license="LGPL"
[[ `grep -c "[ ]*GNU LESSER GENERAL PUBLIC LICENSE[ ]*" \
$tmpdir/$pck_rootdir/COPYING` -eq 0 ]] || spec_license="LGPL"
[[ `grep -c "Copyright .* World Wide Web Consortium" \
$tmpdir/$pck_rootdir/COPYING` -eq 0 ]] || spec_license="W3C"
fi
notify.debug "$FUNCNAME: spec_license (1) = \"$spec_license\""
# 4. set 'spec_source'
local spec_preamble_tarball=`echo "${pck_tarball##*/}" |
sed "s,$pck_version,%{version},g"`
local spec_preamble_source=`echo "$spec_source" |
sed "s,$pck_version,%{version},g"`
[ "$spec_source" ] ||
spec_preamble_tarball="http://.../$spec_preamble_tarball"
notify.debug "$FUNCNAME: spec_preamble_tarball = \"$spec_preamble_tarball\""
notify.debug "$FUNCNAME: spec_preamble_source = \"$spec_preamble_source\""
# 5. discover basic documentation and set 'spec_basic_docs'
# standard text documentation files (see 'automake --help')
# + some other documentation files commonly found in several packages
local standard_docs_list='
AUTHORS
BACKLOG
BUGS
CHANGES
COPYING
COPYING.DOC
COPYING.LESSER
COPYING.LIB
CREDITS
ChangeLog*
LICENCE
LICENSE
MANUAL
NEWS
README*
THANKS
TODO
WHATSNEW
WHERE'
local standard_docs doc currdocs currdoc
for doc in $standard_docs_list; do
# `ls' if used to support strings like `ChangeLog*'
currdocs=$(cd $tmpdir/$pck_rootdir && ls $doc 2>/dev/null)
for currdoc in $currdocs; do
# ignore empty documentation files
[ -s $tmpdir/$pck_rootdir/$currdoc ] &&
standard_docs="${standard_docs:+$standard_docs }$currdoc"
done
done
# split the list of docs into multiple lines if necessary
#[ "$docs" ] && docs=`echo $docs | fmt -u -w 77 | sed 's,.*,%doc &,'`
# 6. discover build technology
local build_techology="unknown"
case "$spec_type" in
kde3|kde4|perl|python)
build_techology="$spec_type"
;;
*) if [ -e $tmpdir/$pck_rootdir/CMakeLists.txt ]; then
build_techology="cmake"
elif [ -x $tmpdir/$pck_rootdir/configure ]; then
build_techology="autotools"
fi
;;
esac
# 7. check for internationalization files
local spec_i18n="0"
# note: in the 'tar' tarball there is no 'intl' folder, so we use 'po'
[ "$(LANG=C find $tmpdir/$pck_rootdir/ -type d -name po 2>/dev/null)" ] &&
spec_i18n="1"
# 8. check for manpages
local spec_manpages="0"
[ "$(LANG=C find $tmpdir/$pck_rootdir/ -name Makefile.am \
-exec grep "MANS[ ]*=" {} \; 2>/dev/null)" ] && spec_manpages="1"
[ "$spec_manpages" = 0 ] &&
{ [ "$(LANG=C find $tmpdir/$pck_rootdir/ \
-type f -name "*.[0-9]" 2>/dev/null)" ] && spec_manpages="1"; }
# 9. check for infopages
local spec_infopages="0"
[ "$(LANG=C find $tmpdir/$pck_rootdir/ -name Makefile.am \
-exec grep "info_TEXINFOS[ ]*=" {} \; 2>/dev/null)" ] && spec_infopages="1"
notify.debug "$FUNCNAME: spec_infopages = $spec_infopages"
[ "$spec_infopages" = 0 ] &&
{ [ "$(LANG=C find $tmpdir/$pck_rootdir/ \
-type f -name "*.info" 2>/dev/null)" ] && spec_infopages="1"; }
notify.debug "$FUNCNAME: spec_infopages = $spec_infopages"
# 10. check for gtk-doc documentation
local spec_gtk_doc="0"
[ "$(LANG=C $tmpdir/$pck_rootdir/configure --help 2>/dev/null | \
grep -e "enable-gtk-doc")" ] && {
spec_gtk_doc="1"
[ "$build_techology" = "autotools" ] && spec_cmd_configure="\
$spec_cmd_configure_autotools --enable-gtk-doc"
}
# FIXME: missing support for:
# pkgconfig files
# includedir files
template.expand \
--template "$templatedir/${spec_type}" \
--type "$spec_type" \
--pckname "$pck_name" \
--pckversion "$pck_version" \
--setupmacro "$spec_setup_macro" \
--summary="$spec_summary" \
--license "$spec_license" \
--source "${spec_preamble_source:-$spec_preamble_tarball}" \
--standard-docs "$standard_docs" \
--build-technology "$build_techology" \
--i18n "$spec_i18n" \
--icons-mimetypes "1" \
--infopages "$spec_infopages" \
--manpages "$spec_manpages" \
--pck-apidocs "$spec_gtk_doc" \
--pck-tools "1" \
--shared-libraries "1"
[ "$outfile" ] && specfile.ckeck_defvalues "$outfile"
rm -fr $tmpdir
if [ "$outfile" ]; then
exec 1<&3 3<&- # restore stdout and close fd#3
[ -f "$outfile" ] &&
notify.note $"created specfile"": \`${NOTE}$outfile${NORM}'"
fi
}
specfile.create \
"$spec_type" "$pck_tarball" "$pck_name" "$pck_version" "$outfile"

49
po/it/Makefile Normal file
View File

@ -0,0 +1,49 @@
# Makefile for autospec
# Copyright (C) 2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ../..
include $(srcdir)/Makefile.env
pck_catalogs := $(wildcard *.po)
LANG=it
.SUFFIXES:
.SUFFIXES: .po .mo .in
.po.mo:; @echo "Generating binary message catalog '$@'..."; \
msgfmt $< -o $@
all: locales
locales: $(pck_catalogs:.po=.mo)
install: locales
@destdir="$(DESTDIR)$(localedir)/$(LANG)/LC_MESSAGES";\
$(INSTALL_DIR) $$destdir;\
for f in $(pck_catalogs:.po=); do\
$(INSTALL_DATA) $${f}.mo $$destdir/$${f}.mo;\
done
uninstall:
@for f in $(pck_catalogs:.po=); do\
echo "rm -f $(DESTDIR)$(localedir)/$(LANG)/LC_MESSAGES/$${f}.mo";\
rm -f $(DESTDIR)$(localedir)/$(LANG)/LC_MESSAGES/$${f}.mo;\
done
clean:
rm -f $(pck_catalogs:.po=.mo)

89
po/it/autospec_fe.po Normal file
View File

@ -0,0 +1,89 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
#
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2008-10-08 16:15+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid ""
"This program is free software; you can redistribute it and/or modify it under\n"
"the terms of the GNU General Public License version 2 as published by the\n"
"Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE."
msgstr ""
"Questo è software libero; è possibile redistribuirlo e/o modificarlo nei termini\n"
"della GNU General Public License versione 2 così come pubblicata dalla\n"
"Free Software Foundation. Non è fornita ALCUNA garanzia; neppure di NEGOZIABILITA'\n"
"o di APPLICABILITA' PER UN PARTICOLARE SCOPO."
msgid "Automatically update rpm packages and help creating new specfiles."
msgstr "Aggiorna automaticamente pacchetti rpm ed assiste nella creazione di specfile."
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Update the given package to a specified version and release"
msgstr "Aggiorna il pacchetto indicato ad una specifica versione e release"
msgid "Try to create a specfile for the specified tarball"
msgstr "Cerca di creare uno specfile per il tarball indicato"
msgid "Extract a given file or list of files from a srpm archive"
msgstr "Estrae da un archivio srpm un file o una lista di file indicati"
msgid "Print the value of the given configuration variable"
msgstr "Stampa il valore che la variabile indicata ha nei file di configurazione"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Print version number, then exit"
msgstr "Stampa il numero di versione e termina il programma"
msgid "Run in quiet mode"
msgstr "Non stampa alcun dettaglio delle operazioni in esecuzione"
msgid "Enable the colorized output"
msgstr "Abilita l'output colorato"
msgid "Run in debugging mode (very verbose output)"
msgstr "Attiva la modalità di debugging (output prolisso)"
msgid "Usage"
msgstr "Utilizzo"
msgid "Use '-u -h', '-s -h', '-x -h', and '--eval -h' to display specific command line options."
msgstr "Usa '-u -h', '-s -h', '-x -h', '--eval -h' per avere le opzioni a linea di comando specifiche."
msgid "Report bugs to <davide.madrisan@gmail.com>."
msgstr "Segnalare eventuali bug a <davide.madrisan@gmail.com>."
msgid "library not found"
msgstr "libreria non trovata"
msgid "version"
msgstr "versione"
msgid "unset in the configuration files"
msgstr "non configurato nei file di configurazione"
msgid "plugin not found"
msgstr "plugin non trovato"
msgid "can't create temporary files"
msgstr "impossibile creare file temporanei"
msgid "you're running $me as root"
msgstr "stai eseguendo $me come root"

91
po/it/config-getvar.po Normal file
View File

@ -0,0 +1,91 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# plugins/config-getvar
msgid "this script requires bash version 3 or better"
msgstr "questo script richiede bash versione 3 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid ""
"This program is free software; you can redistribute it and/or modify it under\n"
"the terms of the GNU General Public License version 2 as published by the\n"
"Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE."
msgstr ""
"Questo è software libero; è possibile redistribuirlo e/o modificarlo nei termini\n"
"della GNU General Public License versione 2 così come pubblicata dalla\n"
"Free Software Foundation. Non è fornita ALCUNA garanzia; neppure di NEGOZIABILITA'\n"
"o di APPLICABILITA' PER UN PARTICOLARE SCOPO."
msgid "Print the value of a given configuration variable"
msgstr "Stampa il valore che una data variabile assume nei file di configurazione"
msgid "Usage"
msgstr "Utilizzo"
msgid "where the above options mean"
msgstr "dove le precedenti opzioni significano"
msgid "Print the value of the configuration variable <var>"
msgstr "Stampa il valore che <var> assume nei file di configurazione"
msgid "Use an alternate configuration file"
msgstr "Utilizza un file di configurazione alternativo"
msgid "Default files:"
msgstr "File di default:"
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Print version number, then exit"
msgstr "Stampa il numero di versione e termina il programma"
msgid "Run in quiet mode"
msgstr "Non stampa alcun dettaglio delle operazioni in esecuzione"
msgid "Enable the colorized output"
msgstr "Abilita l'output colorato"
msgid "Run in debugging mode (very verbose output)"
msgstr "Attiva la modalità di debugging (output prolisso)"
msgid "Samples"
msgstr "Alcuni esempi"
msgid "Report bugs to <davide.madrisan@gmail.com>."
msgstr "Segnalare eventuali bug a <davide.madrisan@gmail.com>."
msgid "cannot read"
msgstr "impossibile leggere"
msgid "unrecognized option"
msgstr "opzione non conosciuta"
msgid "configuration file not found"
msgstr "file di configurazione non trovato"
msgid "(bug)"
msgstr "(bug)"
msgid "unknown variable type"
msgstr "tipo di variabile sconosciuto"

110
po/it/libapse.po Normal file
View File

@ -0,0 +1,110 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# lib/libapse.lib
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid "version"
msgstr "versione"
msgid "Find for updates scanning the web."
msgstr "Ricerca aggiornamenti cercando nel web."
msgid "Usage"
msgstr "Utilizzo"
msgid "where the above options mean"
msgstr "dove le precedenti opzioni significano"
msgid "Name of the package"
msgstr "Nome del pacchetto"
msgid "Name of the spec file"
msgstr "Nome dello specfile"
msgid "URL of the project home page"
msgstr "Indirizzo internet dell'homepage del progetto"
msgid "URL with no variable expansion"
msgstr "Indirizzo internet senza espansione delle variabili"
msgid "Proxy"
msgstr "Proxy"
msgid "Proxy user"
msgstr "Utenza proxy"
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Samples"
msgstr "Alcuni esempi"
msgid "Report bugs to <stefano.cotta@openmamba.org>."
msgstr "Segnalare eventuali bug a <stefano.cotta@openmamba.org>."
msgid "(bug)"
msgstr "(bug)"
msgid "\\`getopt' error"
msgstr "errore in \\`getopt'"
msgid "\\`getopt' error: bad command \\`$1'"
msgstr "errore in \\`getopt': comando errato \\`$1'"
msgid "can't create temporary files"
msgstr "impossibile creare file temporanei"
msgid "looking at"
msgstr "cerco in"
msgid "couldn't resolve host"
msgstr "impossibile risolvere il nome dell'host"
msgid "failed to connect to host"
msgstr "impossibile connettersi all'host"
msgid "curl error (exit code: $retval)"
msgstr "errore curl (codice di errore: $retval)"
msgid "not parametric source0 name; cannot update"
msgstr "source0 in formato non parametrico: impossibile aggiornare"
msgid "found version:"
msgstr "versione trovata:"
msgid "last version of \\`${NOTE}$specname${NORM}' found:"
msgstr "ultima versione di \\`${NOTE}$specname${NORM}' trovata:"
msgid "package \\`${NOTE}$specname${NORM}' is already the latest version"
msgstr "il pacchetto \\`${NOTE}$specname${NORM}' è già aggiornato all'ultima versione"
msgid "a new version of \\`${NOTE}$specname${NORM}' is available!"
msgstr "è disponibile una nuova versione di \\`${NOTE}$specname${NORM}'!"
msgid "a newer version of \\`${NOTE}$specname${NORM}' is already installed"
msgstr "è già installata una versione successiva di \\`${NOTE}$specname${NORM}'"
msgid "cannot find a new version of \\`$specname'"
msgstr "impossibile trovare una nuova versione per \\`$specname'"

44
po/it/libcfg.po Normal file
View File

@ -0,0 +1,44 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# lib/libcfg.lib
msgid "library not found"
msgstr "libreria non trovata"
msgid "configuration file not found"
msgstr "file di configurazione non trovato"
msgid "Hint"
msgstr "Suggerimento"
msgid "user \\`$(id -nu)' does not belong to group \\`$packager_group'"
msgstr "l'utente \\`$(id -nu)' non appartiene al gruppo \\`$packager_group'"
msgid "the file \\`$f' should be readable only by the group \\`$packager_group'"
msgstr "il file \\`$f' dovrebbe essere leggibile solo dal gruppo \\`$packager_group'"
msgid "unset in the configuration files"
msgstr "non configurato nei file di configurazione"
msgid "missing variable in the configuration file"
msgstr "variabile non inizializzata nel file di configurazione"
msgid "loading"
msgstr "caricamento di"
msgid "cannot read"
msgstr "impossibile leggere"

23
po/it/libmsgmng.po Normal file
View File

@ -0,0 +1,23 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# lib/libmsgmng.lib
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid "no message"
msgstr "nessun messaggio"

86
po/it/libnetwork.po Normal file
View File

@ -0,0 +1,86 @@
# translation of it.po to Italiana
# Copyright (C) 2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2008-11-05 22:00+0100\n"
"PO-Revision-Date: 2008-11-05 22:00+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# lib/librepository.lib
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid "(bug)"
msgstr "(bug)"
msgid "\\`getopt' error"
msgstr "errore in \\`getopt'"
msgid "\\`getopt' error: bad command \\`$1'"
msgstr "errore in \\`getopt': commando errato \\`$1'"
msgid "not a number"
msgstr "non è un numero"
msgid "missing mandatory arg"
msgstr "parametro mancante"
msgid "can't create temporary files"
msgstr "impossibile creare file temporanei"
msgid "getting list of files from"
msgstr "ricavo l'elenco dei file da"
msgid "couldn't resolve host"
msgstr "impossibile risolvere il nome dell'host"
msgid "failed to connect to host"
msgstr "impossibile connettersi all'host"
msgid "failure in receiving network data"
msgstr "impossibile recevere dati via rete"
msgid "curl error (exit code: $retval)"
msgstr "errore curl (codice di errore: $retval)"
msgid "unsupported query type for this protocol"
msgstr "ricerca non supportata in questo protocollo"
msgid "cannot get the list of files"
msgstr "impossibile ottenere la lista dei file"
msgid "no list of architectures set"
msgstr "nessuna lista di architetture specificata"
msgid "unsupported protocol"
msgstr "protocollo non supportato"
msgid "not an internet address"
msgstr "non è un indirizzo internet"
msgid "no such directory"
msgstr "cartella non trovata"
msgid "cannot download"
msgstr "impossibile scaricare"
msgid "unknown action"
msgstr "azione sconosciuta"
msgid "package not found"
msgstr "pacchetto non trovato"
msgid "downloading"
msgstr "download di"

146
po/it/libspec.po Normal file
View File

@ -0,0 +1,146 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# lib/libspec.lib
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid "(bug)"
msgstr "(bug)"
msgid "missing mandatory arg"
msgstr "parametro mancante"
msgid "detected a specfile with unsupported syntax:"
msgstr "lo specfile usa una sintassi non supportata:"
msgid "\\`getopt' error"
msgstr "errore in \\`getopt'"
msgid "\\`getopt' error: bad command \\`$1'"
msgstr "errore in \\`getopt': comando errato \\`$1'"
msgid "specfile not found"
msgstr "specfile non trovato"
msgid "can't create temporary files"
msgstr "impossibile creare file temporanei"
msgid "rpm exited with error code \\`$?'"
msgstr "rpm è teminato con error \\`$?'"
msgid "FIXME: sorry, not implemented yet..."
msgstr "FIXME: spiacente, implementazione mancante..."
msgid "\\`%end' found; should perhaps be \\`%endif'"
msgstr "\\`%end' utilizzata; forse si intendeva \\`%endif'"
msgid "cannot evaluate:"
msgstr "impossibile valutare:"
msgid "assertion failed:"
msgstr ""
msgid "version"
msgstr "versione"
msgid "Get informations from a given specfile."
msgstr "Ricava informazioni da un specfile dato."
msgid "Usage"
msgstr "Utilizzo"
msgid "where the above options mean"
msgstr "dove le precedenti opzioni significano"
msgid "name (and patch) of the specfile"
msgstr "nome (e percorso) dello specfile"
msgid "do not try to expand variables"
msgstr "non cercare di espandere le variabili"
msgid "and <query> belongs to the following list"
msgstr "e <query> appartiene alla lista seguente"
msgid "list of package groups"
msgstr "lista dei gruppi utilizzati"
msgid "full name of the srpm package"
msgstr "nome completo del pacchetto srpm"
msgid "list of patches"
msgstr "lista delle patch"
msgid "name of the source0 file"
msgstr "name del file indicato da source0"
msgid "list of source files"
msgstr "lista dei source file"
msgid "list of all the generated rpm packages"
msgstr "lista dei pacchetti rpm generati"
msgid "list of the obsoleted packages"
msgstr "lista dei pacchetti resi obsoleti"
msgid "list of the declared build requirements"
msgstr "lista dei \\`build requirements' dichiarati"
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Samples"
msgstr "Alcuni esempi"
msgid "Report bugs to <davide.madrisan@gmail.com>."
msgstr "Segnalare eventuali bug a <davide.madrisan@gmail.com>."
msgid "bad specfile preamble"
msgstr "preambolo dello specfile non conforme"
msgid "bad arg \\`$var'"
msgstr "argomento errato \\`$var'"
msgid "cannot initialize \\`$var' from specfile data"
msgstr "impossibile assegnare un valore a \\`$var' usando i dati dello specfile"
msgid "directory not found"
msgstr "cartella non trovata"
msgid "file not found"
msgstr "file non trovato"
msgid "skipped"
msgstr "ignorato"
msgid "couldn't resolve host"
msgstr "impossibile risolvere il nome dell'host"
msgid "failed to connect to host"
msgstr "impossibile connettersi all'host"
msgid "curl error (exit code: $retval)"
msgstr "errore curl (codice di errore: $retval)"
msgid "cannot download"
msgstr "impossibile scaricare"

109
po/it/pck-extract.po Normal file
View File

@ -0,0 +1,109 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# plugins/pck-extract
msgid "this script requires bash version 3 or better"
msgstr "questo script richiede bash versione 3 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid ""
"This program is free software; you can redistribute it and/or modify it under\n"
"the terms of the GNU General Public License version 2 as published by the\n"
"Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE."
msgstr ""
"Questo è software libero; è possibile redistribuirlo e/o modificarlo nei termini\n"
"della GNU General Public License versione 2 così come pubblicata dalla\n"
"Free Software Foundation. Non è fornita ALCUNA garanzia; neppure di NEGOZIABILITA'\n"
"o di APPLICABILITA' PER UN PARTICOLARE SCOPO."
msgid "Extract a given file or list of files from a srpm archive"
msgstr "Estrae da un archivio srpm un file o una lista di file indicati"
msgid "Usage"
msgstr "Utilizzo"
msgid "where the above options mean"
msgstr "dove le precedenti opzioni significano"
msgid "Extract from the srpm package <srpm_pck>..."
msgstr "Estrae dal pacchetto srpm <srpm_pck>..."
msgid "...the specified file or list of files <file(s)>"
msgstr "...il file o la lista di file <file(s)>"
msgid "Save extracted files in the directory <dir>"
msgstr "Salva i file estratti nella cartella <dir>"
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Print version number, then exit"
msgstr "Stampa il numero di versione e termina il programma"
msgid "Run in quiet mode"
msgstr "Non stampa alcun dettaglio delle operazioni in esecuzione"
msgid "Enable the colorized output"
msgstr "Abilita l'output colorato"
msgid "Run in debugging mode (very verbose output)"
msgstr "Attiva la modalità di debugging (output prolisso)"
msgid "Samples"
msgstr "Alcuni esempi"
msgid "Report bugs to <davide.madrisan@gmail.com>."
msgstr "Segnalare eventuali bug a <davide.madrisan@gmail.com>."
msgid "cannot read"
msgstr "impossibile leggere"
msgid "unrecognized option"
msgstr "opzione non conosciuta"
msgid "utility not found"
msgstr "programma non trovato"
msgid "can't create temporary files"
msgstr "impossibile creare file temporanei"
msgid "cannot download"
msgstr "impossibile scaricare"
msgid "cannot find:"
msgstr "impossibile trovare:"
msgid "not a srpm package"
msgstr "non è un pacchetto srpm"
msgid "cannot create \\`$destdir'"
msgstr "impossibile creare \\`$destdir'"
msgid "can't save extracted files to \\`$destdir'"
msgstr "impossibile salvare i file estratti in \\`$destdir'"
msgid "can't decompress the file"
msgstr "impossibile decomprimere il file"
msgid "can't save files to \\`$destdir'"
msgstr "impossibile salvare i file in \\`$destdir'"

499
po/it/pck-update.po Normal file
View File

@ -0,0 +1,499 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# plugins/pck-update
msgid "this script requires bash version 3 or better"
msgstr "questo script richiede bash versione 3 o superiore"
msgid "you're running $me as root"
msgstr "stai eseguendo $me come root"
msgid "library not found"
msgstr "libreria non trovata"
msgid ""
"This program is free software; you can redistribute it and/or modify it under\n"
"the terms of the GNU General Public License version 2 as published by the\n"
"Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE."
msgstr ""
"Questo è software libero; è possibile redistribuirlo e/o modificarlo nei termini\n"
"della GNU General Public License versione 2 così come pubblicata dalla\n"
"Free Software Foundation. Non è fornita ALCUNA garanzia; neppure di NEGOZIABILITA'\n"
"o di APPLICABILITA' PER UN PARTICOLARE SCOPO."
msgid "Update the package <pck> to version <ver> and release <rel>"
msgstr "Aggiorna il pacchetto <pck> a versione <ver> e release <rel>"
msgid "Usage"
msgstr "Utilizzo"
msgid "where the above options mean"
msgstr "dove le precedenti opzioni significano"
msgid "Do the actions specified in the comma separated list <lst>"
msgstr "Esegue la lista di azioni separate da virgole <lst>"
msgid "check for available versions in the $DISTRO repositories"
msgstr "cerca se il pacchetto è disponibile nei repository $DISTRO"
msgid "download and install the srpm package"
msgstr "download ed installazione del pacchetto srpm"
msgid "check if a new version is available"
msgstr "controlla se è disponibile un aggiornamento"
msgid "download new source files"
msgstr "download dei nuovi file sorgente"
msgid "update and check the specfile"
msgstr "aggiornamento e controllo dello specfile"
msgid "build the rpm(s) and srpm packages"
msgstr "creazione dei pacchetti rpm e srpm"
msgid "build the list of the build requirements"
msgstr "creazione della lista dei build requirement"
msgid "simulate the installation of the rpm package(s)"
msgstr "simulazione dell'installazione dei pacchetti rpm"
msgid "perform some quality and security checks"
msgstr "esecuzione dei test di qualità e sicurezza"
msgid "calculate the md5/sha1 hashing values"
msgstr "calcolo dei valori di hashing md5 e sha1"
msgid "upload the new packages to the ftp repository"
msgstr "upload dei nuovi pacchetti sul sito ftp"
msgid "*remove* old packages from the ftp repository"
msgstr "*rimozione* dei vecchi pacchetti dal sito ftp"
msgid "(move packages to \\`\\$ftp_rw_old_dir', if set)"
msgstr "(backup in \\`\\$ftp_rw_old_dir', se definita)"
msgid "install the new rpm packages"
msgstr "installazione dei nuovi pacchetti rpm"
msgid "Force the update of the rpm(s) and srpm packages"
msgstr "Forza l'aggiornamento dei pacchetti rpm e srpm"
msgid "Force the rebuild of the rpm(s) and srpm packages"
msgstr "Ricrea comunque i pacchetti rpm e srpm"
msgid "Install the new packages even if rpm complains for errors"
msgstr "Installa i nuovi pacchetti anche in caso di errori rpm"
msgid "Download the source files even if found in SOURCE"
msgstr "Scarica i file sorgente anche se presenti in SOURCE"
msgid "Try to execute the given action(s) bypassing errors"
msgstr "Cerca di eseguire comunque le azioni specificate"
msgid "Skip the given test number(s)"
msgstr "Non esegue i test indicati"
msgid "Define variables <v1>,<v2>,... with values <r1>,<r2>,..."
msgstr "Assegna alle variabili v1,v2,... i valori r1,r2,..."
msgid "Select a server from where to download srpm packages"
msgstr "Server da utilizzare nel download dei pacchetti"
msgid "Select a server where to upload packages"
msgstr "Server dove effettuare l'upload dei pacchetti"
msgid "Select a server to be used for both download and upload"
msgstr "Server per l'upload e il download dei pacchetti"
msgid "FTP user (usr) and password (pswd) for packages upload"
msgstr "User (usr) e password (pswd) per l'upload sul sito FTP"
msgid "Name of the specfile (default: <name>.spec)"
msgstr "Nome dello specfile (default: <name>.spec)"
msgid "Force the architecture to a given value"
msgstr "Forza un valore per l'architettura"
msgid "Set change information for the package"
msgstr "Scrive il messaggio indicato nel changelog del pacchetto"
msgid "action"
msgstr "azione"
msgid "Only build the rpm packages"
msgstr "Crea soltanto i pacchetti rpm"
msgid "Do not upload the srpm package"
msgstr "Non effettua l'upload del pacchetto srpm"
msgid "Only build the srpm package"
msgstr "Crea soltanto il pacchetto srpm"
msgid "Do not upload the rpm packages"
msgstr "Non effettua l'upload dei pacchetti rpm"
msgid "Remove all the temporary files except (s)rpm packages"
msgstr "Rimuove tutti i file temporanei"
msgid "Enable specfile autoformatting"
msgstr "Abilita la riformattazione dello specfile"
msgid "Unable logging to file (logging dir: \\`\\$logging_dir')"
msgstr "Abilita il log su file (nella directory: \\`\\$logging_dir'"
msgid "Enable rebuilding mode and settings (action 4 only)"
msgstr "Attiva modalità ed impostazioni di rebuild (azione 4)"
msgid "Specify an alternative root directory to rpm"
msgstr "Definisce una root directory alternativa per rpm"
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Print version number, then exit"
msgstr "Stampa il numero di versione e termina il programma"
msgid "Run in quiet mode"
msgstr "Non stampa alcun dettaglio delle operazioni in esecuzione"
msgid "Enable the colorized output"
msgstr "Abilita l'output colorato"
msgid "Run in debugging mode (very verbose output)"
msgstr "Attiva la modalità di debugging (output prolisso)"
msgid "Samples"
msgstr "Alcuni esempi"
msgid "changelog entry"
msgstr "stringa di changelog"
msgid "Report bugs to <davide.madrisan@gmail.com>."
msgstr "Segnalare eventuali bug a <davide.madrisan@gmail.com>."
msgid "cannot read"
msgstr "impossibile leggere"
msgid "no such file or directory"
msgstr "file o cartella non trovata"
msgid "unrecognized option"
msgstr "opzione non conosciuta"
msgid "utility not found"
msgstr "programma non trovato"
msgid "must be set in the configuration file"
msgstr "non inizializzato nei file di configurazione"
msgid "must have the same size"
msgstr "devono avere la stessa dimensione"
msgid "illegal value"
msgstr "valore non valido"
msgid "assuming as specfile"
msgstr "assumo che lo specfile sia"
msgid "unsupported path for specfile"
msgstr "persorso dello specfile non supportato"
msgid "specfile not found"
msgstr "specfile non trovato"
msgid "(bug)"
msgstr "(bug)"
msgid "missing mandatory arg"
msgstr "parametro mancante"
msgid "release number: unsupported format"
msgstr "release: formato non supportato"
msgid "checking"
msgstr "sto controllando"
msgid "running test"
msgstr "esecuzione test"
msgid "skipped"
msgstr "ignorato"
msgid "does not point to a valid internet address"
msgstr "non fa riferimento ad un indirizzo internet"
msgid "not a standard structure (see config file)"
msgstr "nome con struttura non standard (vedi configurazione)"
msgid "found \\`-D' and/or \\`-T' option(s) in the \\`%setup' directive"
msgstr "sospetta opzione \\`-D' e/o \\`-T' nella direttiva \\`%setup'"
msgid "missing at least one \\`%defattr' directive"
msgstr "manca almeno una direttiva \\`%defattr'"
msgid "use rpm macros if possible:"
msgstr "utilizzare le macro rpm quando possibile:"
msgid "localization files must be packaged via \\`%find_lang'"
msgstr "trovati file di localizzazione non gestiti da \\`%find_lang'"
msgid "Hint"
msgstr "Suggerimento"
msgid "info pages"
msgstr "pagine info"
msgid "info pages are not installed/uninstalled in the correct way"
msgstr "le pagine info non vengono installate/disinstallate correttamente"
msgid "package Groups"
msgstr "campi Group dei pacchetti"
msgid "invalid \\`Group'"
msgstr "\\`Group' non valido"
msgid "see configuration files"
msgstr "guarda nei file di configurazione"
msgid "or enter the command"
msgstr "oppure esegui il comando"
msgid "approved License"
msgstr "Licenza valida"
msgid "not approved \\`License'"
msgstr "\\`License' non approvata"
msgid "illegal value for arg"
msgstr "valore non valido per l'argomento"
msgid "\\`getopt' error"
msgstr "errore in \\`getopt'"
msgid "\\`getopt' error: bad command \\`$1'"
msgstr "errore in \\`getopt': comando errato \\`$1'"
msgid "can't create temporary files"
msgstr "impossibile creare file temporanei"
msgid "can't create temporary directory"
msgstr "impossibile creare la cartella temporanea"
msgid "command line architecture ignored, using:"
msgstr "ignoro l'architettura indicata ed uso:"
msgid "unsupported architecture"
msgstr "architettura non supportata"
msgid "missing package name"
msgstr "nome del pacchetto mancante"
msgid "cannot create logging directory"
msgstr "impossibile creare la directory di logging"
msgid "logging file"
msgstr "file di log"
msgid "cannot evaluate:"
msgstr "impossibile valutare:"
msgid "no action specified: set with \\`--action'"
msgstr "nessuna azione specificata: utilizzare \\`--action'"
msgid "sintax error in --action \\`$4'"
msgstr "errore di instassi in --action \\`$4'"
msgid "sintax error in the command"
msgstr "errore di sintassi nel comando"
msgid "updating package ${NOTE}${pck_name##*/}${NORM} to version ${NOTE}${pck_newver:-[?]}${NORM}"
msgstr "aggiornamento del pacchetto ${NOTE}${pck_name##*/}${NORM} alla versione ${NOTE}${pck_newver:-[?]}${NORM}"
msgid "updating package"
msgstr "aggiornamento del pacchetto"
msgid "found too many candidates"
msgstr "trovati troppi pacchetti candidati"
msgid "Repository"
msgstr "Archivio"
msgid "Package(s)"
msgstr "Pacchetto"
msgid "cannot find a matching SRPM package in the given repositories"
msgstr "impossibile trovare il pacchetto SRPM nei repository indicati"
msgid "downloading"
msgstr "download di"
msgid "got from"
msgstr "scaricato da"
msgid "cannot download"
msgstr "impossibile scaricare"
msgid "installing"
msgstr "installazione di"
msgid "making a ${NOTE}backup copy${NORM} of the current specfile"
msgstr "creazione di una ${NOTE}copia di backup${NORM} dello specfile corrente"
msgid "an error occurred while installing \\`$got_SPEC_FILENAME'"
msgstr "si è verificato un errore installando \\`$got_SPEC_FILENAME'"
msgid "version for new package required"
msgstr "versione del nuovo pacchetto non indicata"
msgid "check the specfile for common mistakes"
msgstr "controllo dello specfile alla ricerca di comuni errori"
msgid "${NOTE}updating${NORM} the new specfile \\`${NOTE}$spec_dir/$SRPM_SPECFILE${NORM}'"
msgstr "${NOTE}aggiornamento${NORM} del nuovo specfile \\`${NOTE}$spec_dir/$SRPM_SPECFILE${NORM}'"
msgid "specfile autoformattig enabled"
msgstr "formattazione automatica dello specfile abilitata"
msgid "illegal \\`format_extra_rules' (see configuration file(s))"
msgstr "\\`format_extra_rules' non corretta (vedi file di configurazione)"
msgid "missing entry forced"
msgstr "aggiunta voce mancante"
msgid "missing entry in the specfile:"
msgstr "voce mancante nello specfile:"
msgid "FIXME: sorry, not implemented yet..."
msgstr "FIXME: spiacente, implementazione mancante..."
msgid "\\`%description' has empty body"
msgstr "trovata \\`%description' senza testo"
msgid "parsing the \\`%package' block"
msgstr "parsing del blocco \\`%package'"
msgid "cannot create \\`$spec_dir/$SRPM_SPECFILE'"
msgstr "impossibile creare \\`$spec_dir/$SRPM_SPECFILE'"
msgid "build the srpm package"
msgstr "crea il pacchetto srpm"
msgid "LD_LIBRARY_PATH is set"
msgstr "LD_LIBRARY_PATH è definita"
msgid "PYTHONDONTWRITEBYTECODE is set"
msgstr "PYTHONDONTWRITEBYTECODE è definita"
msgid "the version entered at command line doesn't match the version set in the specfile"
msgstr "versione specificata a linea di comando differente da quanto indicato nello specfile"
msgid "the release entered at command line doesn't match the release set in the specfile"
msgstr "release specificata a linea di comando differente da quato indicato nello specfile"
msgid "building the rpm packages"
msgstr "creazione dei pacchetti rpm"
msgid "specfile is newer than rpm package(s) (according to modification date)"
msgstr "lo specfile è più recente del/dei pacchetto/i rpm"
msgid "building the srpm package"
msgstr "creazione del pacchetto srpm"
msgid "specfile is newer than srpm (according to modification date)"
msgstr "lo specfile è più recente del file srpm"
msgid "build requirement found"
msgstr "trovato build requirement"
msgid "installing missing build requirement"
msgstr "installazione del \"build requirement\""
msgid "cannot install the needed build requirements"
msgstr "impossibile installare i \"build requirement\" necessari"
msgid "found ${NOTE}missing BuildRequirement${NORM} \\`${NOTE}$f${NORM}'"
msgstr "trovato ${NOTE}BuildRequirement non soddisfatto${NORM} \\`${NOTE}$f${NORM}'"
msgid "testing out specfile"
msgstr "esecuzione dei test sullo specfile"
msgid "rpmbuild exited with error code \\`$?'"
msgstr "rpmbuild è terminato con il codice d'errore \\`$?'"
msgid "building rpm and srpm packages"
msgstr "creazione dei pacchetti rpm e srpm"
msgid "release for new package required"
msgstr "release del nuovo pacchetto non indicata"
msgid "package not found"
msgstr "pacchetto non trovato"
msgid "rpm exited with error code:"
msgstr "rpm è terminato con il codice di errore:"
msgid "cannot extract files from rpm archive"
msgstr "impossibile estrarre i file dall'archivio rpm"
msgid "cannot extract files from cpio archive"
msgstr "impossibile estrarre i file dall'archivio cpio"
msgid "server unreachable"
msgstr "server non raggiungibile"
msgid "you have no read write access to url#$ftp_server_upload_num"
msgstr "accesso in scrittura alla url#$ftp_server_upload_num vietato"
msgid "unset in the configuration files"
msgstr "non configurato nei file di configurazione"
msgid "ftp upload has been disabled"
msgstr "l'upload dei pacchetti via ftp è stato disabilitato"
msgid "trying with the ${NOTE}anonymous login${NORM}"
msgstr "provo ad utilizzare un ${NOTE}login anonimo${NORM}"
msgid "no old packages have been found."
msgstr "non sono stati trovati vecchi pacchetti."
msgid "moving old packages to the remote backup folder"
msgstr "sposto i vecchi pacchetti nella directory di backup del repository"
msgid "removing old packages from the repository"
msgstr "rimozione dei vecchi pacchetti dal sito"
msgid "force enabled"
msgstr "forzata"
msgid "cannot install the new rpm packages"
msgstr "impossibile installare i pacchetti rpm"
msgid "unknown step \\`$step'"
msgstr "lo step \\`$step' non esiste"
msgid "cleaning up temporary files"
msgstr "eliminazione dei file temporanei"
msgid "removing source packages and patches, if any"
msgstr "rimozione dei pacchetti sorgente e delle patch, se presenti"
msgid "removing"
msgstr "rimozione di"

206
po/it/spec-create.po Normal file
View File

@ -0,0 +1,206 @@
# translation of it.po to Italiana
# Copyright (C) 2004-2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2004-09-01 22:48+0200\n"
"PO-Revision-Date: 2005-11-05 18:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
msgid "this script requires bash version 3 or better"
msgstr "questo script richiede bash versione 3 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid ""
"This program is free software; you can redistribute it and/or modify it under\n"
"the terms of the GNU General Public License version 2 as published by the\n"
"Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE."
msgstr ""
"Questo è software libero; è possibile redistribuirlo e/o modificarlo nei termini\n"
"della GNU General Public License versione 2 così come pubblicata dalla\n"
"Free Software Foundation. Non è fornita ALCUNA garanzia; neppure di NEGOZIABILITA'\n"
"o di APPLICABILITA' PER UN PARTICOLARE SCOPO."
msgid "Try to create a specfile for the specified source archive"
msgstr "Cerca di creare uno specfile per l'archivio sorgente indicato"
msgid "Usage"
msgstr "Utilizzo"
msgid "where the above options mean"
msgstr "dove le precedenti opzioni significano"
msgid "Name of the package (default: taken from <source-archive> name)"
msgstr "Nome del pacchetto (default: ricavato dal nome dell'archivio sorgente)"
msgid "Version of the package (default: taken from <source-archive> name)"
msgstr "Versione del pacchetto (default: ricavato dal nome dell'archivio sorgente)"
msgid "Typology of the specfile to be created"
msgstr "Categoria dello specfile da generare"
msgid "standard specfile (default)"
msgstr "specfile standard (default)"
msgid "specfile for gnome packages"
msgstr "specfile per pacchetti gnome"
msgid "specfile for kde3 packages"
msgstr "specfile per pacchetti kde3"
msgid "specfile for kde4 packages"
msgstr "specfile per pacchetti kde4"
msgid "specfile for common library packages"
msgstr "specfile per librerie"
msgid "specfile for single-package perl modules"
msgstr "specfile per singoli moduli perl"
msgid "specfile for python modules"
msgstr "specfile per moduli python"
msgid "standard specfile for system/network services"
msgstr "specfile per servizi di sistema/rete"
msgid "Redirect the output to the file <outfile>"
msgstr "Redirige lo standard output sul file <outfile>"
msgid "Operation modes"
msgstr "Modalità operative"
msgid "Print this help, then exit"
msgstr "Stampa questa schermata di aiuto e termina il programma"
msgid "Print version number, then exit"
msgstr "Stampa il numero di versione e termina il programma"
msgid "Run in quiet mode"
msgstr "Non stampa alcun dettaglio delle operazioni in esecuzione"
msgid "Enable the colorized output"
msgstr "Abilita l'output colorato"
msgid "Run in debugging mode (very verbose output)"
msgstr "Attiva la modalità di debugging (output prolisso)"
msgid "Samples"
msgstr "Alcuni esempi"
msgid "Report bugs to <davide.madrisan@gmail.com>."
msgstr "Segnalare eventuali bug a <davide.madrisan@gmail.com>."
msgid "cannot read"
msgstr "impossibile leggere"
msgid "unrecognized option"
msgstr "opzione non conosciuta"
msgid "utility not found"
msgstr "programma non trovato"
msgid "info-page"
msgstr "pagina-info"
msgid "(bug)"
msgstr "(bug)"
msgid "illegal arg#1 for \\`$FUNCNAME'"
msgstr "argomento #1 per \\`$FUNCNAME' non lecito"
msgid "missing arg#2 in \\`$FUNCNAME $1'"
msgstr "argomento #2 in \\`$FUNCNAME $1' mancante"
msgid "unknown build techonology"
msgstr "tecnologia di build sconosciuta"
msgid "file not found"
msgstr "file non trovato"
msgid "remember to modify the value for \\`${NOTE}$id${NORM}'"
msgstr "ricordarsi di modificare il valore di \\`${NOTE}$id${NORM}'"
msgid "FIXME: sorry, not implemented yet..."
msgstr "FIXME: spiacente, implementazione mancante..."
msgid "(see $templatedir)"
msgstr "(si veda $templatedir)"
msgid "unknown specfile --type"
msgstr "\\`--type' indicato sconosciuto"
msgid "skipped"
msgstr "ignorato"
msgid "cannot download"
msgstr "impossibile scaricare"
msgid "unsupported protocol"
msgstr "protocollo non supportato"
msgid "missing tarball name"
msgstr "manca il nome del tarball"
msgid "cannot find the package $pck_tarball"
msgstr "impossibile trovare il pacchetto $pck_tarball"
msgid "cannot get the package name, use the \\`-n' option"
msgstr "impossibile ricavare il nome del pacchetto, usa l'opzione \\`-n'"
msgid "invalid version number"
msgstr "numero di versione non valido"
msgid "cannot get the package version, use the \\`-v' option"
msgstr "impossibile ricavare la versione del pacchetto, usa l'opzione \\`-v'"
msgid "output file"
msgstr "file di output"
msgid "can't create output file"
msgstr "impossibile creare il file di output"
msgid "generating specfile"
msgstr "generazione dello specfile"
msgid "source"
msgstr "sorgente"
msgid "mode"
msgstr "modo"
msgid "libraries must have this name structure (use \\`-n'):"
msgstr "i nomi delle librerie devono avere questa struttura (usare \\`-n'):"
msgid "perl modules must have this name structure (use \\`-n'):"
msgstr "i nomi dei moduli perl devono avere questa struttura (usare \\`-n'):"
msgid "python modules must have this name structure (use \\`-n'):"
msgstr "i nomi dei moduli python devono avere questa struttura (usare \\`-n'):"
msgid "can't create temporary directory"
msgstr "impossibile creare directory temporanee"
msgid "unsupported package compression method"
msgstr "metodo di compressione del pacchetto non supportato"
msgid "neither \\`Makefile' nor \\`Makefile.in' has been found"
msgstr "\\`Makefile' e \\`Makefile.in' non trovati"
msgid "looks like a perl package (use \\`-t perl' if this is true)"
msgstr "sembra un pacchetto perl (in questo caso usa \\`-t perl')"
msgid "looks like a python module (use \\`-t python' if this is true)"
msgstr "sembra un modulo python (in questo caso usa \\`-t python')"
msgid "created specfile"
msgstr "creato specfile"

104
po/it/test01_pkgquality.po Normal file
View File

@ -0,0 +1,104 @@
# translation of it.po to Italiana
# Copyright (C) 2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2008-10-28 22:00+0100\n"
"PO-Revision-Date: 2008-10-28 22:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# tests/pkg_security_test_001
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid "performing quality checks"
msgstr "esecuzione dei test di qualità"
msgid "\\`getopt' error"
msgstr "errore in \\`getopt'"
msgid "(bug)"
msgstr "(bug)"
msgid "missing mandatory arg"
msgstr "parametro mancante"
msgid "cannot read"
msgstr "impossibile leggere"
msgid "no such file or directory"
msgstr "file o cartella non trovata"
msgid "checking for wrong symbolic links"
msgstr "ricerca di link simbolici errati"
msgid "empty string"
msgstr "stringa vuota"
msgid "checking"
msgstr "controllo"
msgid "checking for \\`$SPEC_BUILDROOT' (%buildroot) strings"
msgstr "ricerca della stringa \\`$SPEC_BUILDROOT' (%buildroot)"
msgid "skipped"
msgstr "ignorato"
msgid "checking for \\`$BUILDDIR' (%_builddir) strings"
msgstr "ricerca della stringa \\`$BUILDDIR' (%_builddir)"
msgid "checking for suspicious plugins in devel packages"
msgstr "controllo di plugin sospetti nei pacchetti devel"
msgid "found suspect plugin \\`${NOTE}$f${NORM}'"
msgstr "trovato sospetto plugin \\`${NOTE}$f${NORM}'"
msgid "checking for wrong file attributes in bin and lib directories"
msgstr "ricerca di file binari e librerie con permessi errati"
msgid "found suspect file"
msgstr "file sospetto"
msgid "Hint"
msgstr "Suggerimento"
msgid "checking for binary files installed in /etc (see FHS)"
msgstr "ricerca di file binari installati in /etc (vedi FHS)"
msgid "checking if the info catalog is updated when necessary"
msgstr "controllo se il registro delle pagine info viene aggiornato"
msgid "info pages should be installed/uninstalled"
msgstr "le pagine info dovrebbero essere installate/disinstallate"
msgid "checking packages for wrong user and/or group ownerships"
msgstr "ricerca di pacchetti contenenti file con errato utente e/o gruppo"
msgid "package not found"
msgstr "pacchetto non trovato"
msgid "checking packages for desktop files installed in the applnk dir"
msgstr "ricerca di pacchetti con file desktop installati in applnk"
msgid "create desktop files for:"
msgstr "creare file desktop per:"
msgid "see:"
msgstr "vedere:"
msgid "checking for packages with bad BuildArch tag"
msgstr "ricerca di pacchetti con errato tag BuildArch"
msgid "this package should be tagged \\`noarch'"
msgstr "questo pacchetto dovrebbe essere di tipo \\`noarch'"

View File

@ -0,0 +1,62 @@
# translation of it.po to Italiana
# Copyright (C) 2008 Davide Madrisan
# Davide Madrisan <davide.madrisan@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"POT-Creation-Date: 2008-10-28 22:00+0100\n"
"PO-Revision-Date: 2008-10-28 22:03+0100\n"
"Last-Translator: Davide Madrisan <davide.madrisan@gmail.com>\n"
"Language-Team: Italiana <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10.2\n"
# tests/pkg_security_test_001
msgid "this script requires bash version 2 or better"
msgstr "questo script richiede bash versione 2 o superiore"
msgid "library not found"
msgstr "libreria non trovata"
msgid "performing security checks"
msgstr "esecuzione dei test di sicurezza"
msgid "\\`getopt' error"
msgstr "errore in \\`getopt'"
msgid "(bug)"
msgstr "(bug)"
msgid "missing mandatory arg"
msgstr "parametro mancante"
msgid "cannot read"
msgstr "impossibile leggere"
msgid "no such file or directory"
msgstr "file o cartella non trovata"
msgid "checking for RPATH vulnerabilities"
msgstr "ricerca di vulnerabilità di tipo RPATH"
msgid "checking"
msgstr "controllo"
msgid "checking for setuid binaries"
msgstr "ricerca di binari setuid"
msgid "checking for unsecure use of \\`\\$\\$' in shell and perl scripts"
msgstr "ricerca di script shell e perl che utilizzano \\`\\$\\$' in modo insicuro"
msgid "seems to be affected"
msgstr "sembra affetto"
msgid "Hint for bash scripts (\\`mktemp' required)"
msgstr "Suggerimento per script bash (richiede \\`mktemp')"
msgid "Hint for perl scripts"
msgstr "Suggerimento per script perl"

36
templates/Makefile Normal file
View File

@ -0,0 +1,36 @@
# Makefile for autospec
# Copyright (C) 2008,2011 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ..
include $(srcdir)/Makefile.env
pck_templates := gnome kde3 kde4 library perl python standard standard-daemon
all:
install: $(pck_templates)
@$(INSTALL_DIR) $(DESTDIR)$(templatedir)
for f in $(pck_templates); do\
$(INSTALL_DATA) $${f} $(DESTDIR)$(templatedir)/$${f};\
done
uninstall:
for f in $(pck_templates); do\
rm -f $(DESTDIR)$(templatedir)/$${f};\
done
clean:

69
templates/gnome Normal file
View File

@ -0,0 +1,69 @@
%define gnomever n1.n2.n3
%define gnomemajver %(echo %gnomever | cut -d. -f 1-2)
%define gnomegroup ...
%define pkgname ...
Name: %{pkgname}
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: ...
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: http://www.gnome.org
# bugfixes: http://ftp.acc.umu.se/pub/GNOME/sources/%{pkgname}-*.tar.bz2
Source: http://ftp.gnome.org/pub/GNOME/%{gnomegroup}/%{gnomemajver}/%{gnomever}/sources/%{pkgname}-%{version}.tar.bz2
License: GPL
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
BuildRequires: gtk-doc
BuildRoot: @rpm_default_buildroot@
%description
...
@if:library_apidocs
%package apidocs
Summary: %{pkgname} API documentation
Group: Documentation
Requires: gtk-doc
%description apidocs
%{pkgname} API documentation.
@fi:library_apidocs
%prep
%setup -q -n %{pkgname}-%{version}
%build
@if:library_apidocs
@configure@ --enable-gtk-doc
@else:library_apidocs
@configure@
@fi:library_apidocs
@make@
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@makeinstall@
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
@standard_docs@
@if:library_apidocs
%files apidocs
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_datadir}/gtk-doc/html/%{name}
@fi:library_apidocs
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

42
templates/kde3 Normal file
View File

@ -0,0 +1,42 @@
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: ...
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: $packager_fullname <$packager_email>
URL: ...
Source: ...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: ...
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
BuildRoot: @rpm_default_buildroot@
%description
...
%prep
%setup -q
#%patch0 -p1
%build
%configure_kde
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
@standard_docs@
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

113
templates/kde4 Normal file
View File

@ -0,0 +1,113 @@
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: ...
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: http://www.kde.org
Source: ...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: ...
BuildRequires: cmake
BuildRequires: libqt4-devel
BuildRequires: kdelibs4-devel
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
Requires: kdelibs4
Requires: kdebase-runtime
BuildRoot: @rpm_default_buildroot@
%description
...
%prep
%setup -q
#%patch0 -p1
%build
%cmake_kde4 -d build
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C build
@if:i18n
%find_lang %{name} --all-name --with-kde
@fi:i18n
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
@if:shared_libraries
## remove the following line if no dynamic libraries are provided by this package
/sbin/ldconfig
@fi:shared_libraries
@if:icons_mimetypes
touch --no-create %{_kde4_icondir}/hicolor &>/dev/null
touch --no-create %{_kde4_icondir}/oxygen &>/dev/null
@fi:icons_mimetypes
exit 0
@if:icons_mimetypes
%posttrans
@fi:icons_mimetypes
@if:shared_libraries
## remove the following line if no dynamic libraries are provided by this package
/sbin/ldconfig
@fi:shared_libraries
@if:icons_mimetypes
update-desktop-database -q &>/dev/null
update-mime-database %{_kde4_mimedir} &>/dev/null
gtk-update-icon-cache %{_kde4_icondir}/hicolor &>/dev/null
gtk-update-icon-cache %{_kde4_icondir}/oxygen &>/dev/null
exit 0
@fi:icons_mimetypes
%postun
@if:shared_libraries
## remove the following line if no dynamic libraries are provided by this package
/sbin/ldconfig
@fi:shared_libraries
@if:icons_mimetypes
if [ $1 -eq 0 ]; then
\ update-desktop-database -q &>/dev/null
\ update-mime-database %{_kde4_mimedir} &>/dev/null
\ touch --no-create %{_kde4_icondir}/hicolor &>/dev/null
\ touch --no-create %{_kde4_icondir}/oxygen &>/dev/null
\ gtk-update-icon-cache %{_kde4_icondir}/hicolor &>/dev/null
\ gtk-update-icon-cache %{_kde4_icondir}/oxygen &>/dev/null
fi
@fi:icons_mimetypes
exit 0
@if:i18n
%files -f %{name}.lang
@else:i18n
%files
@fi:i18n
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_kde4_bindir}/%{name}
# %{_kde4_datadir}/%{name}
# %{_kde4_dbusinterfacesdir}/org.kde.*.xml
# %{_kde4_kcfgdir}/*.kcfg
# %{_kde4_libdir}/kde4/*.so
# %{_kde4_icondir}/hicolor/*/*/*.png
# %{_kde4_icondir}/oxygen/*/*/*.png
# %{_kde4_icondir}/oxygen/scalable/*/*.svgz
# %{_kde4_xdgappsdir}/*.desktop
# %{_kde4_servicesdir}/*.desktop
# %config %{_kde4_configdir}/*.knsrc
# %doc %lang(en) %{_kde4_htmldir}/en/%{name}
## note: "man3" pages normally goes to devel package if any
# %{_mandir}/man?/%{name}.*
@standard_docs@
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

137
templates/library Normal file
View File

@ -0,0 +1,137 @@
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: System/Libraries
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: ...
Source: ...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: ...
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
@if:infopages
Requires(post): %{__install_info}
@fi:infopages
BuildRoot: @rpm_default_buildroot@
%description
...
%package devel
Group: Development/Libraries
Summary: Static libraries and headers for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description devel
...
This package contains static libraries and header files need for development.
@if:pck_tools
%package tools
Group: Applications/...
Summary: Utility applications for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description tools
The %{name}-tools package contains utility applications for %{name}.
@fi:pck_tools
@if:pck_apidocs
%package apidocs
Group: Documentation
Summary: %{name} API documentation
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: gtk-doc
%description apidocs
This package includes the %{name} API documentation.
@fi:pck_apidocs
%prep
%setup -q
#%patch0 -p1
%build
@if:pck_apidocs
@configure@ --enable-gtk-doc
@else:pck_apidocs
@configure@
@fi:pck_apidocs
@make@
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@makeinstall@
@if:i18n
%find_lang %{name}
@fi:i18n
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@if:infopages
%post devel
## modify the infopage name as required
%install_info %{name}.info
exit 0
%preun devel
## modify the infopage name as required
%uninstall_info %{name}.info
exit 0
@fi:infopages
@if:i18n
%files -f %{name}.lang
@else:i18n
%files
@fi:i18n
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_libdir}/*.so.*
# %{_mandir}/man1/*
@standard_docs@
%files devel
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_bindir}/%{name}-config
# %{_datadir}/aclocal/*.m4
# %{_includedir}/*.h
# %{_includedir}/%{name}
# %{_libdir}/*.a
# %{_libdir}/*.la
# %{_libdir}/*.so
# %{_libdir}/pkgconfig/*.pc
# %{_mandir}/man3/*
@if:infopages
# %{_infodir}/*.info.*
@fi:infopages
@if:pck_tools
%files tools
%defattr(-,root,root)
## note: list all the binaries but %{name}-config
# %{_bindir}/...
## note: usually there's a manpages for each tool
# %{_mandir}/man1/*
@fi:pck_tools
@if:pck_apidocs
%files apidocs
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_datadir}/gtk-doc/html/%{name}
@fi:pck_apidocs
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

58
templates/perl Normal file
View File

@ -0,0 +1,58 @@
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ... - ...
Group: System/Libraries/Perl
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: http://www.cpan.org
Source: http://www.cpan.org/modules/by-module/...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: GPL, Artistic
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
BuildRequires: perl-devel
Requires: perl >= %perl_major_ver
BuildRoot: @rpm_default_buildroot@
%description
...
%prep
%setup -q
#%patch0 -p1
%build
%{__perl} Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%make
%make test
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall_perl
packlist=`find %{buildroot} -name .packlist`
[ -z "$packlist" ] && exit 1 || cat $packlist | \\
\ sed "s,%{buildroot},,g;s,.*/man/.*,&.gz,g" | \\
\ sort -u > .packlist && rm -f $packlist
strid=`echo $packlist | sed 's,.*auto\\(.*\\)/.packlist,\\1,'`
for dir in `find %{buildroot} -type d | grep $strid`; do
\ echo "%dir ${dir#%buildroot}" >> .packlist
done
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files -f .packlist
%defattr(-,root,root)
@standard_docs@
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

48
templates/python Normal file
View File

@ -0,0 +1,48 @@
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: System/Libraries
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: ...
Source: ...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: ...
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
BuildRequires: libpython-devel
Requires: python >= %python_version
BuildRoot: @rpm_default_buildroot@
%description
...
%prep
%setup -q
#%patch0 -p1
%build
CFLAGS="%{optflags}" %{__python} setup.py build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%{__python} setup.py install \\
\ -O1 --skip-build \\
\ --root="%{buildroot}" \\
\ --install-headers=%{_includedir}/python \\
\ --install-lib=%{python_sitearch} \\
\ --single-version-externally-managed \\
\ --record=%{name}.filelist
sed -i "\\,\\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
%files -f %{name}.filelist
%defattr(-,root,root)
@standard_docs@
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

95
templates/standard Normal file
View File

@ -0,0 +1,95 @@
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: ...
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: ...
Source: ...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: ...
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
@if:infopages
Requires(post): %{__install_info}
@fi:infopages
BuildRoot: @rpm_default_buildroot@
%description
...
@if:pck_apidocs
%package apidocs
Group: Documentation
Summary: %{name} API documentation
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: gtk-doc
%description apidocs
This package includes the %{name} API documentation.
@fi:pck_apidocs
%prep
%setup -q
#%patch0 -p1
%build
@if:pck_apidocs
@configure@ --enable-gtk-doc
@else:pck_apidocs
@configure@
@fi:pck_apidocs
@make@
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@makeinstall@
@if:i18n
%find_lang %{name}
@fi:i18n
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@if:infopages
%post devel
## modify the infopage name as required
%install_info %{name}.info
exit 0
%preun devel
## modify the infopage name as required
%uninstall_info %{name}.info
exit 0
@fi:infopages
@if:i18n
%files -f %{name}.lang
@else:i18n
%files
@fi:i18n
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_bindir}/%{name}
# %{_datadir}/%{name}
# %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
# %{_mandir}/man?/*
@if:infopages
# %{_infodir}/*.info.*
@fi:infopages
@standard_docs@
@if:pck_apidocs
%files apidocs
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_datadir}/gtk-doc/html/%{name}
@fi:pck_apidocs
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

119
templates/standard-daemon Normal file
View File

@ -0,0 +1,119 @@
Name: @pck_name@
Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@
Summary: ...
Group: ...
Vendor: @VENDOR@
Distribution: @DISTRO@
Packager: @packager_fullname@ <@packager_email@>
URL: ...
Source: ...
#Patch0: %{name}-<pck-version>-<patch-description>.patch
License: ...
## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END
@if:infopages
Requires(post): %{__install_info}
@fi:infopages
BuildRoot: @rpm_default_buildroot@
%description
...
@if:pck_apidocs
%package apidocs
Group: Documentation
Summary: %{name} API documentation
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: gtk-doc
%description apidocs
This package includes the %{name} API documentation.
@fi:pck_apidocs
%prep
%setup -q
#%patch0 -p1
%build
@if:pck_apidocs
@configure@ --enable-gtk-doc
@else:pck_apidocs
@configure@
@fi:pck_apidocs
@make@
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@makeinstall@
@if:i18n
%find_lang %{name}
@fi:i18n
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
/usr/sbin/useradd -s /bin/false -r -d <service_homedir> \\
\ -c "service description" <service_name> &>/dev/null || :
%post
if [ $1 -eq 1 ]; then
\ /sbin/chkconfig --add <daemon_name>
\ /sbin/service <daemon_name> start
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
\ /sbin/service <daemon_name> stop &>/dev/null || :
\ /sbin/chkconfig --del <daemon_name>
fi
exit 0
%postun
if [ $1 -ge 1 ]; then
\ /sbin/service <daemon_name> condrestart &>/dev/null || :
fi
exit 0
@if:infopages
%post devel
## modify the infopage name as required
%install_info %{name}.info
exit 0
%preun devel
## modify the infopage name as required
%uninstall_info %{name}.info
exit 0
@fi:infopages
@if:i18n
%files -f %{name}.lang
@else:i18n
%files
@fi:i18n
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_bindir}/%{name}
# %{_datadir}/%{name}
# %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
# %{_mandir}/man?/*
@if:infopages
# %{_infodir}/*.info.*
@fi:infopages
@standard_docs@
@if:pck_apidocs
%files apidocs
%defattr(-,root,root)
## note: this list is just an example; modify as required
# %{_datadir}/gtk-doc/html/%{name}
@fi:pck_apidocs
%changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@
- @spec_changelog_comment@

45
tests/Makefile Normal file
View File

@ -0,0 +1,45 @@
# Makefile for autospec
# Copyright (C) 2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ..
include $(srcdir)/Makefile.env
pck_tests := test01_pkgquality test02_pkgsecurity
pck_tests_infiles := $(wildcard *.in)
all:
check: $(pck_tests)
@for f in $(pck_tests); do\
echo -n "checking $$f... ";\
bash -n $$f \
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
install: $(pck_tests)
@$(INSTALL_DIR) $(DESTDIR)$(testdir)
for f in $(pck_tests); do\
$(INSTALL_SCRIPT) $${f} $(DESTDIR)$(testdir)/$${f};\
done
uninstall:
for f in $(pck_tools); do\
rm -f $(DESTDIR)$(tooldir)/$${f};\
done
clean:
rm -f $(patsubst %.in,%,$(pck_tests_infiles))

367
tests/test01_pkgquality.in Normal file
View File

@ -0,0 +1,367 @@
#!/bin/bash
# test01_pkgquality -- @package@ test (rpm quality checks)
# Copyright (C) 2008 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="test01_pkgquality"; export TEXTDOMAIN
function alltests() {
# FIXME: add to 'po' file
notify.note "** ${NOTE}"$"performing quality checks""${NORM}""..."
TEMP=`LANG=C getopt \
-o i:t: --long infofile:,tmpdir: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || return 1
eval set -- "$TEMP"
while :; do
case "$1" in
-i|--infofile)
rpminfofile="$2"
shift
;;
-t|--tmpdir)
tmpextractdir="$2"
shift
;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error" ;;
esac
shift
done
[ "$rpminfofile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--infofile)"
[ -r "$rpminfofile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"cannot read"" \`$rpminfofile'"
. $rpminfofile
[ "$tmpextractdir" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--tmpdir)"
[ -d "$tmpextractdir" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"no such file or directory"" \`$tmpextractdir'"
# check for broken symlinks
# - symlinks to files in the buildroot directory for rpm
# (usable for a symlink attacks)
# - symlinks not pointing to existing files
notify.note \
" * ${NOTE}"$"checking for wrong symbolic links""${NORM}..."
# local rpmbuildroot=`sed -n "/%description/q;{
# /^BuildRoot[ ]*:/{s/[^ ]*[ ]*//;p}}" \
# $spec_dir/$SRPM_SPECFILE | \
# sed "s,%[{]*name[}]*,$SPEC_NAME,
# s,%[{]*version[}]*,$SPEC_VERSION,
# s,%[{]*_tmppath[}]*,$tmppath_dir,;p"`
# FIXME: 'tmppath_dir' should be get from configuration files
tmppath_dir=`rpm --eval %_tmppath 2>/dev/null`
[ "$tmppath_dir" ] ||
notify.error $"(bug)"" -- $FUNCNAME: ""empty string"" (tmppath_dir)"
notify.debug "tmppath_dir = $tmppath_dir"
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
for f in $(find -mindepth 1 -type l); do
notify.debug "$f --> `readlink $f`"
# FIXME: the check fails if 'BuildRoot' doesn't start
# by '%_{tmppath}'
# note: the first condition check for wrong links, like
# /usr/share/man/man1/zcmp.1.gz -> .gz
# made by the broken `brp-compress' script in rpm 4.0.4
[[ "$(readlink $f)" = ".gz" || \
"$(readlink $f)" =~ $tmppath_dir ]] && notify.warning $"\
wrong symlink"": \`${NOTE}${f/./}${NORM}' --> \`${NOTE}$(readlink $f)${NORM}'"
done
popd >/dev/null
let "i += 1"
done
###
# check for `%buildroot' strings
if [ "$rpm_ignores_buildroot" = 1 ]; then
notify.note \
" * ${NOTE}"$"checking for \`$SPEC_BUILDROOT' (%buildroot) strings"\
"${NORM}... "$"skipped"
else
notify.note \
" * "$"checking for \`$SPEC_BUILDROOT' (%buildroot) strings"
[ "$SPEC_BUILDROOT" ] ||
notify.error \
$"(bug)"" -- $FUNCNAME: ""empty string"" (SPEC_BUILDROOT)"
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
find $tmpextractdir/$i -type f \
-exec grep -ls "$SPEC_BUILDROOT" {} \; | \
while read filename; do
notify.note " ${NOTE}$(\
echo $filename | sed "s,$tmpextractdir/$i,," )${NORM}"
notify.note "$(\
strings -a $filename | grep "^$SPEC_BUILDROOT" | sort -bu | \
sed "s,$SPEC_BUILDROOT\(.*\), - [%buildroot]\1,")"
done
let "i += 1"
done
fi
###
# check for `%_builddir' strings
BUILDDIR="$(rpm --eval=%_builddir 2>/dev/null)"
notify.note \
" * ${NOTE}"$"checking for \`$BUILDDIR' (%_builddir) strings""${NORM}... "
[ "$BUILDDIR" ] ||
notify.error $"(bug)"" -- $FUNCNAME: ""empty string"" (BUILDDIR)"
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
find $tmpextractdir/$i -type f \
-exec grep -ls "$BUILDDIR" {} \; | \
while read filename; do
notify.note " ${NOTE}$(\
echo $filename | sed "s,$tmpextractdir/$i,," )${NORM}"
notify.note "$(\
strings -a $filename | grep "$BUILDDIR" | sort -bu | \
sed "s,$BUILDDIR,[%_builddir],g;s,.*, - &,")"
done
let "i += 1"
done
###
# check for suspected plugins (.la, .so) in devel packages
# note: pure plugins must be in the main package, not in devel
notify.note " * ${NOTE}"$"\
checking for suspicious plugins in devel packages""${NORM}..."
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
# skip non devel packages
[[ "${pck##*/}" =~ -devel- ]] || { let "i += 1"; continue; }
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
# find *.so files that are not symlinks to dynamic libraries
for f in `\
find -mindepth 1 -type f -name \*.so -exec file {} \; | \
grep ' shared object,' | sed -n 's/.\(.*\):.*/\1/p'`; do
notify.warning $"found suspect plugin \`${NOTE}$f${NORM}'"
done
popd >/dev/null
let "i += 1"
done
###
# check for wrong file attributes in lib and bin dirs
notify.note " * ${NOTE}"$"\
checking for wrong file attributes in bin and lib directories""${NORM}..."
warning=0
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
for f in $( find . -type f \
\( -name '*.so*' -not -perm 755 \) -or \
\( \( -path './bin/*' -or \
-path './sbin/*' -or \
-path './usr/bin/*' -or \
-path './usr/sbin/*' \) \
-not -perm -111 \) 2>/dev/null ); do
let "warning = 1" &&
notify.warning $"found suspect file"": \
\`${NOTE}${f/./}${NORM}' [$(ls -l "$f" | sed 's, .*,,')]"
done
let "i += 1"
popd >/dev/null
done
[[ $warning -eq 0 ]] || notify.note "\
-----------------------------
${NOTE}"$"Hint"":${NORM}
# fixup strange shared library permissions
chmod 755 %{buildroot}%{_libdir}/*.so*
%files
%defattr(-,root,root)
...
%attr(0755,root,root) %{_bindir}/<program>
-----------------------------"
###
# check for binary files in etc (see FHS-2.2)
notify.note " * ${NOTE}"$"\
checking for binary files installed in /etc (see FHS)""${NORM}..."
warning=0
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
for f in $( find ./etc -type f -perm +111 2>/dev/null ); do
case $f in
./etc/rc.d/init.d/*) ;;
*) let "warning = 1" &&
notify.warning $"found suspect file"": \
\`${NOTE}${f/./}${NORM}' [$(ls -l "$f" | sed 's, .*,,')]" ;;
esac
done
popd >/dev/null
let "i += 1"
done
[ "$warning" = 0 ] || notify.note "\
-----------------------------
${NOTE}"$"Hint"":${NORM}
%files
%defattr(-,root,root)
...
%attr(0644,root,root) %{_sysconfdir}/<...file>
-----------------------------" #|| exit 1
###
# check for installation code needed by info pages
notify.note \
" * ${NOTE}"$"checking if the info catalog is updated when necessary""${NORM}..."
error=0
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
[[ -e $pck ]] || notify.error $"package not found"": \`${pck##*/}'"
[[ "$(rpm -p -ql $pck |
# FIXME: this check only works for FHS-compliant distros
grep "^$(rpm --eval %_infodir)")" ]] ||
{ let "i += 1"; continue; } # no info pages found
#notify.debug "$FUNCNAME: info page(s) found"
[[ "$(rpm -p -q --scripts $pck | sed -n '
/postinstall /,${/\/sbin\/install-info \/.*/p}')" ]] || let "error+=1"
[[ "$(rpm -p -q --scripts $pck | sed -n '
/preuninstall /,${/\/sbin\/install-info.*--[delete\|remove].*/p}')" ]] || \
let "error+=1"
[[ "$error" = "0" ]] || notify.warning "\
"$"info pages should be installed/uninstalled""${NORM}
---------------------------------------
${NOTE}"$"Hint"":${NORM}
$([[ "$rpm_macro_installinfo_binary" ]] &&
echo "Requires(post):$rpm_macro_installinfo_binary" ||
echo "Requires(post):${path_installinfo:-/sbin/install-info}")
%post [<subpackage>]
$([[ "$rpm_macro_installinfo" ]] &&
echo "$rpm_macro_installinfo %{name}.info" ||
echo "${path_installinfo:-/sbin/install-info} %{name}.info")
%preun [<subpackage>]
$([[ "$rpm_macro_uninstallinfo" ]] &&
echo "$rpm_macro_uninstallinfo %{name}.info" ||
echo "${path_installinfo:-/sbin/install-info} --delete %{name}.info")
exit 0
---------------------------------------"
done
###
# check packages for wrong user and/or group ownerships
notify.note " * ${NOTE}"$"\
checking packages for wrong user and/or group ownerships""${NORM}..."
error=0
idun="$(id -un)" idgn="$(id -gn)"
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
[[ -e $pck ]] || notify.error $"\
package not found"": \`${pck##*/}'"
( LANG=C rpm -p -qlv $pck | \
while read line; do
set -- $line
# FIXME : find a better check, perhaps using a range
# of uid reserved for users
[[ "$idun" = "$3" || "$idgn" = "$4" ]] &&
notify.warning $"found suspect file"": \
\`${NOTE}$9${NORM}' [uid:\`${NOTE}$3${NORM}', gid:\`${NOTE}$4${NORM}']"
done )
done
###
# check for desktop files installed in non standard applnk dir
notify.note " * ${NOTE}"$"\
checking packages for desktop files installed in the applnk dir""${NORM}..."
warning=0
rpmdatadir=$(rpm --eval %_datadir 2>/dev/null)
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
for f in $( find .${rpmdatadir} -type f 2>/dev/null ); do
case $f in
.${rpmdatadir}/applnk/*.desktop)
let "warning = 1" &&
notify.warning $"found suspect file"": \
\`${NOTE}${f/./}${NORM}' [$(ls -l "$f" | sed 's, .*,,')]" ;;
*) ;;
esac
done
popd >/dev/null
done
[ "$warning" = 0 ] || notify.note "\
-----------------------------
${NOTE}"$"Hint"":${NORM}
"$"create desktop files for:"" ${rpmdatadir}/applications
"$"see:"" <http://www.freedesktop.org/>
-----------------------------"
###
# check if a package that do not contains binaries is tagged noarch
notify.note \
" * ${NOTE}"$"checking for packages with bad BuildArch tag""${NORM}..."
warning=0
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
for f in $(find -mindepth 2 -perm +111 -type f \
-exec file {} \; | grep -E "( ELF | library )"); do
notify.debug "found a ELF file: \`${NOTE}${f/./}${NORM}'"
let "warning = 1"
break
done
popd >/dev/null
done
if [ "$warning" = 0 ]; then
[ "$SPEC_BUILDARCH" = "noarch" ] || notify.warning "\
"$"this package should be tagged \`noarch'""
-----------------------------
${NOTE}"$"Hint"":${NORM}
BuildArch: noarch
-----------------------------"
fi
}

149
tests/test02_pkgsecurity.in Normal file
View File

@ -0,0 +1,149 @@
#!/bin/bash
# test02_pkgsecurity -- @package@ test (rpm security checks)
# Copyright (C) 2008 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="test02_pkgsecurity"; export TEXTDOMAIN
function alltests() {
# FIXME: add to 'po' file
notify.note "** ${NOTE}"$"performing security checks""${NORM}""..."
TEMP=`LANG=C getopt \
-o i:t: --long infofile:,tmpdir: \
-n "$FUNCNAME" -- "$@"`
[ $? = 0 ] || return 1
eval set -- "$TEMP"
while :; do
case "$1" in
-i|--infofile)
rpminfofile="$2"
shift
;;
-t|--tmpdir)
tmpextractdir="$2"
shift
;;
--) shift; break ;;
*) notify.error $"\
(bug)"" -- $FUNCNAME: "$"\`getopt' error" ;;
esac
shift
done
[ "$rpminfofile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--infofile)"
[ -r "$rpminfofile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"cannot read"" \`$rpminfofile'"
. $rpminfofile
[ "$tmpextractdir" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (--tmpdir)"
[ -d "$tmpextractdir" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"no such file or directory"" \`$tmpextractdir'"
function security.filecheckrpath() {
# $1: file to check
# RPATH /usr/lib/.:/usr/lib/qt3/lib:/usr/lib:/usr/X11R6/lib
objdump -p $1 2>/dev/null | \
sed -n '/RPATH/{s/.* \(.*\)/\1:/p}' | \
while read -d: path; do
# try to discard false positive warnings
[[ "${allowed_libdirs}:" =~ ${path}: ]] || echo -n "$path "
done
}
notify.note \
" * ${NOTE}"$"checking for RPATH vulnerabilities""${NORM}..."
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
# find ELF binaries (ELF 32-bit LSB executable)
# and libs (ELF 32-bit LSB shared object)
for f in $(find -mindepth 2 -perm +111 -type f); do
if [[ "$(file $f | grep " ELF ")" ]]; then
rpath="$(security.filecheckrpath $f)"
[[ "$rpath" ]] && notify.warning "${f/./}\nRPATH: $rpath"
fi
done
popd >/dev/null
let "i += 1"
done
###
notify.note \
" * ${NOTE}"$"checking for setuid binaries""${NORM}..."
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
# find setuid binaries
# NOTE: find output is different for normal and root users
for f in $(find -mindepth 2 -perm +111 -type f); do
[[ "$(file $f | grep " setuid ")" ]] &&
notify.warning "${NOTE}${f/./}${NORM}"
done
popd >/dev/null
let "i += 1"
done
###
# checking for unsecure use of $$ as random source in shell scripts
notify.note " * ${NOTE}"$"\
checking for unsecure use of \`\$\$' in shell and perl scripts""${NORM}..."
vulnerable=0
let "i = 0"
for pck in ${rpmpkg_name[@]}; do
notify.note " - "$"checking"": \`${pck##*/}'"
pushd $tmpextractdir/$i >/dev/null
for f in $(find -mindepth 1 -perm +111 -type f); do
# we are interesting only in shell scripts
[[ "$(file $f | grep "shell script\|perl script")" ]] ||
continue
# check for string like:
# - tmp=/tmp/zfoo.$$
# - gzip -cdfq "$2" > /tmp/"$F".$$
[[ \
-n "$(grep $f -m1 -s -rl -e"[^[:space:]]*=.*\$\$")" ||
-n "$(grep $f -m1 -s -rl -e">[[:space:]]*.*[[:space:]]*[^[:space:]]*\$\$")" ]] &&
let "vulnerable = 1" &&
notify.warning $"\
seems to be affected"": \`${NOTE}${f/./}${NORM}'"
done
popd >/dev/null
let "i += 1"
done
[[ $vulnerable -eq 1 ]] && notify.note "\
-----------------------------
${NOTE}"$"Hint for bash scripts (\`mktemp' required)"":${NORM}
tmpdir=\`mktemp -d /tmp/<script_name>.XXXXXX\` ||
{ echo \"Cannot create directory \\\`\$tmpdir'. Aborting.\" >&2; exit 1; }
trap 'ret=\$?; rm -rf \$tmpdir && exit \$ret' 0
trap '(exit $?); exit' 1 2 13 15
tmpfile=\`env TMPDIR=\"\" mktemp -p \$tmpdir tmpfile.XXXXXX\` ||
{ echo \"Cannot create temporary file \\\`\$tmpfile'. Aborting.\" >&2; exit 1; }
${NOTE}"$"Hint for perl scripts"":${NORM}
use File::Temp qw/ tempfile /;
(\$fh,\$file) = tempfile ('<script_name>.XXXXXX');
-----------------------------"
}

45
tools/Makefile Normal file
View File

@ -0,0 +1,45 @@
# Makefile for autospec
# Copyright (C) 2008 by Davide Madrisan <davide.madrisan@gmail.com>
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY, to the extent permitted by law; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
srcdir = ..
include $(srcdir)/Makefile.env
pck_tools := autoupdate-perl_modules extract-specs kde4-flist2rpmvars
pck_tools_infiles := $(wildcard *.in)
all:
check: $(pck_tools)
@for f in $(pck_tools); do\
echo -n "checking $$f... ";\
bash -n $$f \
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
install: $(pck_tools)
@$(INSTALL_DIR) $(DESTDIR)$(tooldir)
for f in $(pck_tools); do\
$(INSTALL_SCRIPT) $${f} $(DESTDIR)$(tooldir)/$${f};\
done
uninstall:
for f in $(pck_tools); do\
rm -f $(DESTDIR)$(tooldir)/$${f};\
done
clean:
rm -f $(patsubst %.in,%,$(pck_tools_infiles))

View File

@ -0,0 +1,97 @@
#!/bin/bash
# $autoupdate-perl_modules -- update all perl modules
# Copyright (C) 2005,2006 Davide Madrisan <davide.madrisan@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.
#
# Report bugs to <davide.madrisan@gmail.com>
# FIXME : WORK IN PROGRESS ...
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
me=("${0##*/}" "0.1.1")
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
export LANG
fi
TEXTDOMAIN="@package@"; export TEXTDOMAIN
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
spec_dir=`rpm --eval %_specdir 2>/dev/null`
spec_changelog="automatically rebuild"
eval $(autospec -q --eval=logging_dir)
[ "$logging_dir" ] || logging_dir="${tmppath_dir:-/var/tmp}/@package@"
# FIXME : get the list of perl modules from the repository
# ftp://ftp.qilinux.it:21/pub/QiLinux/devel/SPECS
# WARNING : this variable used for test only
mperl_lst="perl-Archive-Tar.spec"
for mperl in $mperl_lst; do
autospec -u ${mperl/\.spec} -a1
specfile.getvars SPEC_TARGET -s $spec_dir/$mperl_lst
# FIXME : skip packages with multiple targets
[ "${SPEC_TARGET[*]}" = 1 ] ||
{ > $logging_dir/${mperl/\.spec}.skipped
continue; }
# specfile fixes
grep -q "%define PERL_VERSION %(eval" $spec_dir/$mperl &&
{ sed -i "
s,%define PERL_VERSION %(eval \`perl -V:version\`; echo \$version),\
%define perl_major_ver %(eval \`perl -V:version\`; echo \${version%*.[0-9]*}.0),
s,%PERL_VERSION,%{perl_major_ver},g
s,%{PERL_VERSION},%{perl_major_ver},g" $spec_dir/$mperl
tempfile=`mktemp -q specfile.XXXXXXXX` ||
notify.error $"can't create temporary files"
sed "/%install/q" $spec_dir/$mperl > $tempfile
echo "\
[ \"%{buildroot}\" != / ] && rm -rf %{buildroot}
%makeinstall_perl
packlist=\`find %{buildroot} -name .packlist\`
[[ -z \"$packlist\" ]] && exit 1 || cat \$packlist | \
sed \"s,%buildroot,,g;s,.*/man/.*,&.gz,g\" | \
sort -u > .packlist && rm \$packlist
strid=\`echo \$packlist | sed 's,.*auto\(.*\)/.packlist,\1,'\`
for dir in \`find %{buildroot} -type d | grep \$strid\`; do
echo \"%dir \${dir#%buildroot}\" >> .packlist
done
%clean
[ \"%{buildroot}\" != / ] && rm -rf %{buildroot}
rm -f .packlist
%files -f .packlist
%defattr(-,root,root)
"
sed -n '/%changelog/,$p' $spec_dir/$mperl >> $tempfile
mv $tempfile $spec_dir/$mperl
}
sed -i "
s,perl Makefile.PL,perl Makefile.PL INSTALLDIRS=vendor,
s,make %{?_smp_mflags},%make,
s,^make,%make," $spec_dir/$mperl
autospec -u ${mperl/\.spec} -a4 -f --rebuild \
--changelog="$spec_changelog" --log
done

142
tools/extract-specs.in Normal file
View File

@ -0,0 +1,142 @@
#!/bin/bash
# $0 -- get the specfiles from a local repository
# Copyright (C) 2005,2007 Davide Madrisan <davide.madrisan@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.
#
# Report bugs to <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
me=(${0##*/} "0.2.2")
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
# FIXME: add a po file for this script
#if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
# . /etc/sysconfig/i18n
# export LANG
#fi
#TEXTDOMAIN="@package@"; export TEXTDOMAIN
# default values
let "verbose = 1"
let "update_days = 0" # `0' means +\infty
unset update_opt
unset owner_opt
function version() {
echo "\
$me, "$"version"" ${me[1]}""
"$"Get the specfiles from a local repository.""
Copyright (C) 2005-2007 Davide Madrisan <davide.madrisan@gmail.com>"
}
function copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function usage() {
# $1: optional exit code (default is '1')
version
echo "
"$"Usage":"
$me -s <path> -d <path> {-a | -u <int>} [-o <user>:<group>]
"$"where the above options mean":"
-s, --sourcedir "$"The local path where to find for the SRPMS packages""
-d, --destdir "$"The local path where the extracted specfile will be saved""
-a, --all "$"Get the specfiles from all the spmrs packages found""
-u, --update "$"Get the specfiles from srpms last modified <n> days ago""
-o, --owner "$"Set the ownership of all files created to the specified value""
"$"Operation modes":"
-h, --help "$"Print this help, then exit""
-v, --version "$"Print version number, then exit""
-q, --quiet "$"Run in quiet mode""
"$"Some examples":"
$me -s /var/ftp/pub/SRPMS -d /var/temp/SPECS -o ftpuser:ftpuser -u 1
"$"Report bugs to <davide.madrisan@gmail.com>."""
exit ${1:-1}
}
[ $# -eq 0 ] && usage
TEMP=`LANG=C getopt \
-o s:d:au:o:hvq \
--long sourcedir:,destdir:,all,update:,owner:,help,version,quiet \
-n "$me" -- "$@"`
[[ $? = 0 ]] || exit 1
eval set -- "$TEMP"
while :; do
case $1 in
-s|--sourcedir)
sourcedir="$2"; shift ;;
-d|--destdir)
destdir="$2"; shift ;;
-a|--all)
let "update_days = 0"; shift ;;
-u|--update)
update_days="$2"; shift ;;
-o|--owner)
owner_opt="--owner $2"; shift ;;
-q|--quiet)
let "verbose = 0" ;;
-h|--help)
usage 0 ;;
-v|--version)
version; echo; copying; exit 0;;
--) shift; break ;;
*) notify.error $"(bug)"" -- "$"\`getopt' error"
esac
shift
done
[[ -d "$sourcedir" ]] ||
notify.error $"not such a directory"": \`$sourcedir'"
if [[ ! -d "$destdir" ]]; then
mkdir -p "$destdir" 2>/dev/null
[ $? -ne 0 ] &&
notify.error $"cannot create \`$destdir'"
fi
if [ "$update_days" != "0" ]; then
echo "$update_days" | grep -Eq "^[0-9]+$" ||
notify.error $"not a number"": \`$update_days'"
update_opt="-ctime -${update_days}"
fi
pushd $destdir &>/dev/null
[ $? -ne 0 ] && notify.error "$destdir: "$"permission denied"
find "$sourcedir" -maxdepth 1 $update_opt -type f -name \*.src.rpm | \
while read file; do
notify.note $"processing"": $file ..."
rpm2cpio $file 2>/dev/null | \
cpio --quiet --extract --unconditional $owner_opt "*.spec" 2>/dev/null
[ $? -ne 0 ] &&
notify.warning $"cannot extract the specfile from \`$file'"
done
popd &>/dev/null
notify.note $"\nall done, $destdir content updated"

137
tools/kde4-flist2rpmvars.in Normal file
View File

@ -0,0 +1,137 @@
#!/bin/bash
# $0 -- translate the list of files generated by rpm in a list suitable for
# inclusion into a specfile (kde4 only)
# Copyright (C) 2008-2010 Davide Madrisan <davide.madrisan@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.
#
# Report bugs to <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
me=(${0##*/} "0.3.1")
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
# FIXME: add a po file for this script
#if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
# . /etc/sysconfig/i18n
# export LANG
#fi
#TEXTDOMAIN="@package@"; export TEXTDOMAIN
# default values
let "nospaces = 1"
sed_extra_mask="s,^[ \t]*,,"
function version() {
echo "\
$me, "$"version"" ${me[1]}""
"$"Get the specfiles from a local repository.""
Copyright (C) 2008 Davide Madrisan <davide.madrisan@gmail.com>"
}
function copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function usage() {
# $1: optional exit code (default is '1')
version
echo "
"$"Usage":"
$me <file_with_filelist> [-s]
"$"where the above options mean":"
-s, --spaces "$"Do not remove extra-spaces""
"$"Operation modes":"
-h, --help "$"Print this help, then exit""
-v, --version "$"Print version number, then exit""
"$"Some examples":"
$me /tmp/kompare4_filelist
"$"Report bugs to <davide.madrisan@gmail.com>."""
exit ${1:-1}
}
[ $# -eq 0 ] && usage
TEMP=`LANG=C getopt \
-o shv \
--long nospaces,help,version \
-n "$me" -- "$@"`
[[ $? = 0 ]] || exit 1
eval set -- "$TEMP"
while :; do
case $1 in
-s|--nospaces)
let "nospaces = 0"
sed_extra_mask="";;
-h|--help)
usage 0 ;;
-v|--version)
version; echo; copying; exit 0;;
--) shift; break ;;
*) notify.error $"(bug)"" -- "$"\`getopt' error"
esac
shift
done
flist="$1"
[[ -r "$flist" ]] || notify.error $"file not found"": \`$flist'"
# see: /etc/rpm/macros.kde4
cat $flist | \
while read line; do
echo $line | sed "\
$sed_extra_mask
s,/etc/opt/kde,%{_kde4_sysconfdir},
s,/opt/kde/bin,%{_kde4_bindir},
s,/opt/kde/sbin,%{_kde4_sbindir},
\
s,/opt/kde/include,%{_kde4_includedir},
\
s,/opt/kde/lib/kde4/libexec,%{_kde4_libexecdir},
s,/opt/kde/lib/kde4/plugins,%{_kde4_pluginsdir},
s,/opt/kde/lib,%{_kde4_libdir},
\
s,/opt/kde/share/applications,%{_kde4_xdgappsdir},
s,/opt/kde/share/apps/kconf_update,%{_kde4_kconfupdatedir},
s,/opt/kde/share/apps,%{_kde4_datadir},
s,/opt/kde/share/autostart,%{_kde4_autostartdir},
s,/opt/kde/share/config.kcfg,%{_kde4_kcfgdir},
s,/opt/kde/share/config,%{_kde4_configdir},
s,/opt/kde/share/dbus-1/interfaces,%{_kde4_dbusinterfacesdir},
s,/opt/kde/share/dbus-1/services,%{_kde4_dbusservicesdir},
s,/opt/kde/share/desktop-directories,%{_kde4_xdgdirectorydir},
s,/opt/kde/share/doc/HTML,%{_kde4_htmldir},
s,/opt/kde/share/icons,%{_kde4_icondir},
s,/opt/kde/share/kde4/services,%{_kde4_servicesdir},
s,/opt/kde/share/kde4/servicetypes,%{_kde4_servicetypesdir},
s,/opt/kde/share/locale,%{_kde4_localedir},
s,/opt/kde/share/mime/packages,%{_kde4_xdgmimedir},
s,/opt/kde/share/mimelnk,%{_kde4_mimedir},
s,/opt/kde/share/sounds,%{_kde4_soundsdir},
s,/opt/kde/share/templates,%{_kde4_templatesdir},
s,/opt/kde/share/wallpapers,%{_kde4_wallpaperdir},
s,/opt/kde/share,%{_kde4_sharedir},
#s,/opt/kde,%{_kde4_prefix},
"
done | sort

402
unmaintained/autobuild.in Normal file
View File

@ -0,0 +1,402 @@
#!/bin/bash
# autobuild -- plugin for @package@
# Copyright (C) 2006 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] &&
echo $"this script requires bash version 2 or better" >&2 && exit 1
me=(${0##*/} "@version@" "@date@")
[ $(id -u) -eq 0 ] &&
{ echo "$me: "$"you're running $me as root" 1>&2 && exit 1; }
[ -r @libdir@/libmsgmng.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libmsgmng.lib" 1>&2
exit 1; }
. @libdir@/libmsgmng.lib
[ -r @libdir@/libspec.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libspec.lib" 1>&2
exit 1; }
. @libdir@/libspec.lib
# load the configuration file(s)
[ -r @libdir@/libcfg.lib ] ||
{ echo "$me: "$"library not found"": @libdir@/libcfg.lib" 1>&2
exit 1; }
. @libdir@/libcfg.lib
if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then
. /etc/sysconfig/i18n
[ "$LANG" ] && export LANG
fi
TEXTDOMAIN="@package@"; export TEXTDOMAIN
function copying() {
echo "\
"$"This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE."
}
function version() {
echo "\
${me[0]} ${me[1]}
Copyright (C) 2006 Davide Madrisan <davide.madrisan@gmail.com>"
}
function usage() {
version
echo "\
*** FIXME ***
"$"Usage"":
@frontend@ -b <rulesfile> [-T <pck>]
"$"where the above options mean"":
-b, --batch "$"Run in batch mode, using <rulesfile> as a road map""
-T, --target "$"Execute rules only for the given package""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
-V, --version "$"Print version number, then exit""
-q, --quiet "$"Run in quiet mode""
-r, --colorize "$"Enable the colorized output""
-D, --debug "$"Run in debugging mode (very verbose output)""
"$"Samples"":
@frontend@ --batch /var/tmp/autobuild.rules
"$"Report bugs to <davide.madrisan@gmail.com>."
exit ${1:-1}
}
# check if all the needed tools are available
#for tool in ... ; do
# [ "$(type -p $tool)" ] ||
# notify.error $"utility not found": \`$tool'"
#done
case $1 in
--autospec-args-file*)
if echo $1 | grep -q '=' ; then
argsfile=`echo $1 | sed 's/^--autospec-args-file=//'`
else
argsfile=$2
fi
[ -r "$argsfile" ] || notify.error $"cannot read"": \`$argsfile'"
. $argsfile && rm -f $argsfile
;;
esac
for arg in $@; do
case $arg in
-h|--help) usage 0 ;;
-V|--version) version; echo; copying; exit 0 ;;
esac
done
exec_options=`LANG=C getopt \
-o b:T:DqrhV \
--long batch:,target:,\
debug,quiet,colorize,help,version,\
frontend_opts: \
-n "$me" -- "$@"`
[ $? = 0 ] || exit 1
notify.debug "[ ${0} ${exec_options} ]\n"
eval set -- "$exec_options"
while :; do
case $1 in
-b|--batch)
batchfile=$2; shift ;;
-T|--target)
batchtargetpck=$2; shift ;; # FIXME : currently ignored!
-D|--debug)
let "verbose = 2" ;;
-q|--quiet)
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
-h|--help)
usage 0 ;;
-V|--version)
version; echo; copying; exit 0 ;;
--) shift; break ;;
*) notify.error $"unrecognized option"" -- \`$1'" ;;
esac
shift
done
for arg in $@; do
notify.error $"unrecognized option"" -- \`$arg'"
done
[ "$logging" = "1" ] && let "colorize = 0"
[ "$colorize" = "1" ] && notify.enable_colors
# default values for non mandatory configuration variables
[ "$logging_dir" ] || logging_dir="${tmppath_dir:-/var/tmp}/@package@"
# function autobuild.build()
# execute the commands contained in all the rules blocks
# args:
# $1 : none
function autobuild.build() {
# function autobuild.do_current()
# execute the commands contained in a rules block
# args:
# $1 : name (and path) of the rules file
function autobuild.do_current() {
local steps
[ "$download" = true ] && steps="1"
# FIXME: support for `update' is not complete !
if [ -n "$update" ]; then
steps="${steps:+$steps,}4"
[ "$update" = rebuild ] && let "rebuild = 1"
fi
[[ "$build" = true || "$build" = force ]] &&
steps="${steps:+$steps,}5"
[ "$build" = force ] && let "force_build = 1"
[ "$install" = testonly ] && steps="${steps:+$steps,}7"
[ "$install" = true ] && steps="${steps:+$steps,}11"
[ "$install" = force ] &&
{ steps="${steps:+$steps,}11"; let "force_install = 1"; }
[ "$upload" = true ] && steps="${steps:+$steps,}10"
( let "colorize = 0"
notify.disable_colors
package.update \
"${spec_format:-0}" \
"$pck_name" "$pck_newver" "$pck_newrel" \
"$steps" \
"" "" \
"${spec_name:-"${pck_name}.spec"}" \
"$define_list" \
"$ftp_server_download_num" \
"$ftp_server_upload_num"; )
# FIXME: "$changelog_userdef"
let "error = $?"
[ "$error" = 0 ] || notify.warning $"error detected!"
}
local rulesfile="$1"
notify.debug "rulesfile = \"$rulesfile\""
[ "$batchfile" ] || notify.error $"\
(bug)"" -- $FUNCNAME: "$"rulesfile unset"
[ -r $rulesfile ] ||
notify.error $"file not found"": \`$rulesfile'"
notify.note $"parsing"" ${NOTE}$rulesfile${NORM}..."
local linenum=1
unset pck_name
while read line; do
set -- $line
notify.debug "line = \"$line\""
notify.debug " \$1 = \"$1\""
case "$1" in
\#*|"") # skip comments and blank lines
;;
"[COMMANDS]"|"[GLOBAL]"|"[PACKAGES]")
section="$1"
notify.debug "parsing $1 section (line #$linenum)..."
if [ "$section" = "[PACKAGES]" ]; then
# check for syntax errors
[ "$logging_dir" ] ||
notify.error $"undefined directive"" \`logdir'"
[ "$spec_dir" ] ||
notify.error $"undefined directive"" \`specdir'"
fi
# if a package block is yet cached, do autobuild it
# (this happens for the last package listed in the rules file)
if [ "$pck_name" ]; then
notify.debug "batchtargetpck = \"$batchtargetpck\""
notify.debug "pck_name = \"$pck_name\""
[ "$pck_name" = "${batchtargetpck:-$pck_name}" ] &&
autobuild.do_current
unset pck_name
fi
;;
logdir)
[ "$section" = "[GLOBAL]" ] ||
notify.error \
$"misplaced directive"" \`logdir', "$"line"" #$linenum"
logging_dir="$(eval echo $2)"
notify.note "logdir: ${NOTE}$logging_dir${NORM}"
;;
specdir)
[ "$section" = "[GLOBAL]" ] ||
notify.error \
$"misplaced directive"" \`specdir', "$"line"" #$linenum"
spec_dir="$(eval echo $2)"
notify.note "specdir: ${NOTE}$spec_dir${NORM}"
;;
package)
if [ "$pck_name" ]; then
# the previous package block has ended, so the corresponding
# actions must be taken now
notify.debug "batchtargetpck = \"$batchtargetpck\""
notify.debug "pck_name = \"$pck_name\""
if [ "$pck_name" = "${batchtargetpck:-$pck_name}" ]; then
autobuild.do_current
let "error = $?"
[ "$error" = 0 ] ||
notify.warning $"error detected!"" ($pck_name)"
fi
unset pck_name
fi
let "error = 0"
pck_name="$(eval echo $2)"
notify.debug "batchtargetpck = \"$batchtargetpck\""
notify.debug "pck_name = \"$pck_name\""
[ "$pck_name" = "${batchtargetpck:-$pck_name}" ] &&
notify.note "\n*** "$"package"": ${NOTE}$pck_name${NORM}"
;;
specfile_name)
# optional: if missing, specfile_name is set to <package>.spec
spec_name="$2"
;;
download)
[ "$error" = 0 ] || continue
download="$(eval echo $2)"
# legal values: true, false
case "$download" in
true|false) ;;
*) notify.warning \
$"unknown rvalue"" \`$upload', "$"line"" #$linenum"
let "error+=1" ;;
esac
;;
download_server)
[ "$error" = 0 ] || continue
ftp_server_download_num="$(eval echo $2)"
;;
update)
[ "$error" = 0 ] || continue
# legal values are <version_mask>, rebuild, false
# ex: <*.2n.*> (any, even number, any)
# <*.2n+1.*> (any, odd number, any)
# <*> (any number)
update="$(eval echo $2)"
case "$update" in
rebuild|false) ;;
*) # FIXME : implementation is incomplete
# should perhaps make a syntax checking
pck_newver="$update"
notify.debug "pck_newver = \"$pck_newver\""
pck_newrel="$(eval echo $3)"
notify.debug "pck_newrel = \"$pck_newrel\""
;;
esac
;;
build)
[ "$error" = 0 ] || continue
# legal values: false, force, true
build="$(eval echo $2)"
case "$build" in
false|force|true) ;;
*) notify.warning \
$"unknown rvalue"" \`$upload', "$"line"" #$linenum"
let "error+=1" ;;
esac
;;
build_define)
[ "$error" = 0 ] || continue
shift; define_list="$(eval echo $*)"
;;
install)
[ "$error" = 0 ] || continue
# legal values: false, force, testonly, true
install="$(eval echo $2)"
case "$install" in
false|force|testonly|true) ;;
*) notify.warning \
$"unknown rvalue"" \`$upload', "$"line"" #$linenum"
let "error+=1" ;;
esac
;;
upload)
[ "$error" = 0 ] || continue
# legal values: true, false
upload="$(eval echo $2)"
case "$upload" in
true|false) ;;
*) notify.warning \
$"unknown rvalue"" \`$upload', "$"line"" #$linenum"
let "error+=1" ;;
esac
;;
upload_server)
[ "$error" = 0 ] || continue
ftp_server_upload_num="$(eval echo $2)"
;;
*) [ "$section" = "[COMMANDS]" ] &&
{ eval "$line"; continue; }
notify.error \
$"unknown token"" \`$1', "$"line"" #$linenum"
;;
esac
let "linenum += 1"
done < $rulesfile
# if a package block is yet cached, do autobuild it
if [ "$pck_name" ]; then
[ "$pck_name" = "${batchtargetpck:-$pck_name}" ] &&
autobuild.do_current
unset pck_name
fi
}
# function autobuild.doall()
# frontend for this plugin
# args:
# $1 : name (and path) of the rules file
function autobuild.doall() {
local rulesfile="$1"
notify.debug "rulesfile = \"$rulesfile\""
[ "$batchfile" ] || notify.error $"
(bug)"" -- $FUNCNAME: "$"rulesfile unset"
notify.error "FIXME: sorry, this plugin is currently unmantained"
( # set some global variables used by the pck-update plugin
let "logging = 1"
notify.debug $"loading plugin"" \`$plugin_pck_update'..."
# FIXME: switch to the new @package@ architecture !!!
. $plugin_pck_update
autobuild.build "$batchfile"; )
return $?
}
# user configuration file for @package@ required
config.check4user
# make some security checks
config.security
autobuild.doall "$batchfile"

View File

@ -0,0 +1,26 @@
#
# this file is an example of rule file for the autobuild plugin
#
[commands]
# this section can be used to set up some variables used later
# or to call external scripts
sn="$(LC_ALL="C" date "+%Y.%m.%d")"
[global]
specdir /usr/src/RPM/SPECS
logdir /var/tmp/autobuild-$sn
[packages]
package gzip
download false
download_server 0
update rebuild
build force
build_define
install testonly
upload false
upload_server 0
[commands]
echo -e "\\nThat's all."

Some files were not shown because too many files have changed in this diff Show More