#!/bin/bash # rpmdev-packager -- guess rpm packager info from various sources # # Copyright (c) 2009 Ville Skyttä # # 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA version() { cat < 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. EOF } help() { cat <<\EOF rpmdev-packager guesses rpm packager info from various sources: $RPM_PACKAGER from environment (full name + email address) %packager from rpm configuration (full name + email address) /etc/passwd gecos (full name) certificates ~/.fedora.cert (email address) $MAILTO from environment (email address) EOF usage echo "" echo "Report bugs at , component rpmdevtools," echo "or at ." } usage() { cat </dev/null )" [ -n "$packager" -a -n "$fullname" ] && \ packager="$fullname <$packager>" [ -n "$packager" ] && break fi done fi # Try $MAILTO if [ -z "$packager" ] ; then packager="$MAILTO" [ -n "$packager" -a -n "$fullname" ] && packager="$fullname <$packager>" fi # Fall back to full name only [ -z "$packager" ] && packager="$fullname" # Done [ -n "$packager" ] && echo "$packager"