]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update configure script to generate system groups.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 5 Feb 2006 01:00:29 +0000 (01:00 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 5 Feb 2006 01:00:29 +0000 (01:00 +0000)
Update scheduler conf loading code to use default browse
protocols and system groups from configure script.

Fix some more bugs in the RPM spec file.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@5075 7a7537e8-13f0-0310-91df-b6672ffda945

config-scripts/cups-defaults.m4
config-scripts/cups-launchd.m4
config-scripts/cups-opsys.m4
packaging/cups.spec.in
scheduler/conf.c
tools/makesrcdist

index 4da730c2ad229860f09fc321f831ce0cb7bc31eb..9e0d3815d40911e94fda6e5cd506e44dd6e9ecba 100644 (file)
@@ -115,6 +115,97 @@ else
 fi
 AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
 
+dnl Determine the correct username and group for this OS...
+AC_ARG_WITH(cups-user, [  --with-cups-user        set default user for CUPS],
+       CUPS_USER="$withval",
+       AC_MSG_CHECKING(for default print user)
+       if test -f /etc/passwd; then
+               CUPS_USER=""
+               for user in lp lpd guest daemon nobody; do
+                       if test "`grep \^${user}: /etc/passwd`" != ""; then
+                               CUPS_USER="$user"
+                               AC_MSG_RESULT($user)
+                               break;
+                       fi
+               done
+
+               if test x$CUPS_USER = x; then
+                       CUPS_USER="nobody"
+                       AC_MSG_RESULT(not found, using "$CUPS_USER")
+               fi
+       else
+               CUPS_USER="nobody"
+               AC_MSG_RESULT(no password file, using "$CUPS_USER")
+       fi)
+
+AC_ARG_WITH(cups-group, [  --with-cups-group       set default group for CUPS],
+       CUPS_GROUP="$withval",
+       AC_MSG_CHECKING(for default print group)
+       if test -f /etc/group; then
+               if test x$uname = xDarwin; then
+                       GROUP_LIST="nobody"
+               else
+                       GROUP_LIST="lp nobody"
+               fi
+
+               CUPS_GROUP=""
+               for group in $GROUP_LIST; do
+                       if test "`grep \^${group}: /etc/group`" != ""; then
+                               CUPS_GROUP="$group"
+                               AC_MSG_RESULT($group)
+                               break;
+                       fi
+               done
+
+               if test x$CUPS_GROUP = x; then
+                       CUPS_GROUP="nobody"
+                       AC_MSG_RESULT(not found, using "$CUPS_GROUP")
+               fi
+       else
+               CUPS_GROUP="nobody"
+               AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
+       fi)
+
+AC_ARG_WITH(system-groups, [  --with-system-groups    set default system groups for CUPS],
+       CUPS_SYSTEM_GROUPS="$withval",
+       if test x$uname = xDarwin; then
+               GROUP_LIST="lp admin"
+       else
+               GROUP_LIST="lpadmin sys system root"
+       fi
+
+       AC_MSG_CHECKING(for default system groups)
+       if test -f /etc/group; then
+               CUPS_SYSTEM_GROUPS=""
+               for group in $GROUP_LIST; do
+                       if test "`grep \^${group}: /etc/group`" != ""; then
+                               if test "x$CUPS_SYSTEM_GROUPS" = x; then
+                                       CUPS_SYSTEM_GROUPS="$group"
+                               else
+                                       CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
+                               fi
+                       fi
+               done
+
+               if test "x$CUPS_SYSTEM_GROUPS" = x; then
+                       CUPS_SYSTEM_GROUPS="$GROUP_LIST"
+                       AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
+               else
+                       AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
+               fi
+       else
+               CUPS_SYSTEM_GROUPS="$GROUP_LIST"
+               AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
+       fi)
+
+AC_SUBST(CUPS_USER)
+AC_SUBST(CUPS_GROUP)
+AC_SUBST(CUPS_SYSTEM_GROUPS)
+
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
+
 
 dnl
 dnl End of "$Id$".
index 8e075e9bffd2cfa14649cefa0ffe585c2d0c9009..1da73934f48f5d25ea5b9d51c4f2cb69c162f292 100644 (file)
@@ -23,7 +23,7 @@ dnl         WWW: http://www.cups.org
 dnl
 
 
-AC_ARG_ENABLE(launchd, [  --enable-launchd            turn on launchd support, default=yes])
+AC_ARG_ENABLE(launchd, [  --enable-launchd        turn on launchd support, default=yes])
 
 DEFAULT_LAUNCHD_CONF=""
 LAUNCHDLIBS=""
index 951fcaaf5de71986a12703a8e05e2ee22d717f78..aa919ba5bae9cb10fa363d3262301f632d12b211 100644 (file)
@@ -3,7 +3,7 @@ dnl "$Id$"
 dnl
 dnl   Operating system stuff for the Common UNIX Printing System (CUPS).
 dnl
-dnl   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+dnl   Copyright 1997-2006 by Easy Software Products, all rights reserved.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
 dnl   property of Easy Software Products and are protected by Federal
@@ -38,63 +38,6 @@ case "$uname" in
                ;;
 esac
 
-dnl Determine the correct username and group for this OS...
-AC_ARG_WITH(cups-user, [  --with-cups-user        set default user for CUPS],
-       CUPS_USER="$withval",
-       AC_MSG_CHECKING(for default print user)
-       if test -f /etc/passwd; then
-               CUPS_USER=""
-               for user in lp lpd guest daemon nobody; do
-                       if test "`grep \^${user}: /etc/passwd`" != ""; then
-                               CUPS_USER="$user"
-                               AC_MSG_RESULT($user)
-                               break;
-                       fi
-               done
-
-               if test x$CUPS_USER = x; then
-                       CUPS_USER="${USER:=nobody}"
-                       AC_MSG_RESULT(not found, using "$CUPS_USER")
-               fi
-       else
-               CUPS_USER="${USER:=nobody}"
-               AC_MSG_RESULT(no password file, using "$CUPS_USER")
-       fi)
-
-AC_ARG_WITH(cups-group, [  --with-cups-group       set default group for CUPS],
-       CUPS_GROUP="$withval",
-       AC_MSG_CHECKING(for default print group)
-       if test -f /etc/group; then
-               if test x$uname = xDarwin; then
-                       GROUP_LIST="lp admin"
-               else
-                       GROUP_LIST="lpadmin sys system root"
-               fi
-
-               CUPS_GROUP=""
-               for group in $GROUP_LIST; do
-                       if test "`grep \^${group}: /etc/group`" != ""; then
-                               CUPS_GROUP="$group"
-                               AC_MSG_RESULT($group)
-                               break;
-                       fi
-               done
-
-               if test x$CUPS_GROUP = x; then
-                       CUPS_GROUP="${GROUP:=nobody}"
-                       AC_MSG_RESULT(not found, using "$CUPS_GROUP")
-               fi
-       else
-               CUPS_GROUP="${GROUP:=nobody}"
-               AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
-       fi)
-
-AC_SUBST(CUPS_USER)
-AC_SUBST(CUPS_GROUP)
-
-AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
-AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
-
 dnl
 dnl "$Id$"
 dnl
index d9a8898d4eb83667d86847fd181030854d650b51..20772dd84b67a6aa81bda466421ceaa38795658f 100644 (file)
@@ -114,8 +114,8 @@ fi
 
 %postun
 if test $1 -ge 1; then
-       /sbin/service stop
-       /sbin/service start
+       /sbin/service cups stop
+       /sbin/service cups start
 fi
 
 %postun libs
index 8b2d584779bf6f0faff1f516711405b687f14abb..5332856a28ac9c2820a6a41a31071d2da65f6e0f 100644 (file)
@@ -30,6 +30,8 @@
  *   get_addr_and_mask()      - Get an IP address and netmask.
  *   parse_aaa()              - Parse authentication, authorization, and
  *                              access control lines.
+ *   parse_groups()           - Parse system group names in a string.
+ *   parse_protocols()        - Parse browse protocols in a string.
  *   read_configuration()     - Read a configuration file.
  *   read_location()          - Read a <Location path> definition.
  *   read_policy()            - Read a <Policy name> definition.
@@ -190,6 +192,8 @@ static int          get_addr_and_mask(const char *value, unsigned *ip,
                                          unsigned *mask);
 static int             parse_aaa(cupsd_location_t *loc, char *line,
                                  char *value, int linenum);
+static int             parse_groups(const char *s);
+static int             parse_protocols(const char *s);
 static int             read_configuration(cups_file_t *fp);
 static int             read_location(cups_file_t *fp, char *name, int linenum);
 static int             read_policy(cups_file_t *fp, char *name, int linenum);
@@ -310,42 +314,6 @@ cupsdReadConfiguration(void)
   else
     cupsdSetString(&TempDir, getenv("TMPDIR"));
 
- /*
-  * Find the default system group: "sys", "system", or "root"...
-  */
-
-  group = getgrnam(CUPS_DEFAULT_GROUP);
-  endgrent();
-
-  NumSystemGroups = 0;
-
-  if (group != NULL)
-  {
-   /*
-    * Found the group, use it!
-    */
-
-    cupsdSetString(&SystemGroups[0], CUPS_DEFAULT_GROUP);
-
-    SystemGroupIDs[0] = group->gr_gid;
-  }
-  else
-  {
-   /*
-    * Find the group associated with GID 0...
-    */
-
-    group = getgrgid(0);
-    endgrent();
-
-    if (group != NULL)
-      cupsdSetString(&SystemGroups[0], group->gr_name);
-    else
-      cupsdSetString(&SystemGroups[0], "unknown");
-
-    SystemGroupIDs[0] = 0;
-  }
-
  /*
   * Find the default user...
   */
@@ -387,37 +355,38 @@ cupsdReadConfiguration(void)
   * Numeric options...
   */
 
-  ConfigFilePerm      = CUPS_DEFAULT_CONFIG_FILE_PERM;
-  DefaultAuthType     = AUTH_BASIC;
-  JobRetryLimit       = 5;
-  JobRetryInterval    = 300;
-  FileDevice          = FALSE;
-  FilterLevel         = 0;
-  FilterLimit         = 0;
-  FilterNice          = 0;
-  HostNameLookups     = FALSE;
-  ImplicitClasses     = CUPS_DEFAULT_IMPLICIT_CLASSES;
-  ImplicitAnyClasses  = FALSE;
-  HideImplicitMembers = TRUE;
-  KeepAlive           = TRUE;
-  KeepAliveTimeout    = DEFAULT_KEEPALIVE;
-  ListenBackLog       = SOMAXCONN;
-  LogFilePerm         = CUPS_DEFAULT_LOG_FILE_PERM;
-  LogLevel            = CUPSD_LOG_ERROR;
-  MaxClients          = 100;
-  MaxClientsPerHost   = 0;
-  MaxLogSize          = 1024 * 1024;
-  MaxPrinterHistory   = 10;
-  MaxRequestSize      = 0;
-  ReloadTimeout              = 60;
-  RootCertDuration    = 300;
-  RunAsUser           = FALSE;
-  Timeout             = DEFAULT_TIMEOUT;
+  ConfigFilePerm        = CUPS_DEFAULT_CONFIG_FILE_PERM;
+  DefaultAuthType       = AUTH_BASIC;
+  JobRetryLimit         = 5;
+  JobRetryInterval      = 300;
+  FileDevice            = FALSE;
+  FilterLevel           = 0;
+  FilterLimit           = 0;
+  FilterNice            = 0;
+  HostNameLookups       = FALSE;
+  ImplicitClasses       = CUPS_DEFAULT_IMPLICIT_CLASSES;
+  ImplicitAnyClasses    = FALSE;
+  HideImplicitMembers   = TRUE;
+  KeepAlive             = TRUE;
+  KeepAliveTimeout      = DEFAULT_KEEPALIVE;
+  ListenBackLog         = SOMAXCONN;
+  LogFilePerm           = CUPS_DEFAULT_LOG_FILE_PERM;
+  LogLevel              = CUPSD_LOG_ERROR;
+  MaxClients            = 100;
+  MaxClientsPerHost     = 0;
+  MaxLogSize            = 1024 * 1024;
+  MaxPrinterHistory     = 10;
+  MaxRequestSize        = 0;
+  ReloadTimeout                = 60;
+  RootCertDuration      = 300;
+  RunAsUser             = FALSE;
+  Timeout               = DEFAULT_TIMEOUT;
+  NumSystemGroups       = 0;
 
   BrowseInterval        = DEFAULT_INTERVAL;
   BrowsePort            = ippPort();
-  BrowseLocalProtocols  = BROWSE_CUPS; /* TODO: Use configure option */
-  BrowseRemoteProtocols = BROWSE_CUPS; /* TODO: Use configure option */
+  BrowseLocalProtocols  = parse_protocols(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS);
+  BrowseRemoteProtocols = parse_protocols(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS);
   BrowseShortNames      = CUPS_DEFAULT_BROWSE_SHORT_NAMES;
   BrowseTimeout         = DEFAULT_TIMEOUT;
   Browsing              = CUPS_DEFAULT_BROWSING;
@@ -474,7 +443,25 @@ cupsdReadConfiguration(void)
   */
 
   if (NumSystemGroups == 0)
-    NumSystemGroups ++;
+  {
+    if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS))
+    {
+     /*
+      * Find the group associated with GID 0...
+      */
+
+      group = getgrgid(0);
+      endgrent();
+
+      if (group != NULL)
+       cupsdSetString(&SystemGroups[0], group->gr_name);
+      else
+       cupsdSetString(&SystemGroups[0], "unknown");
+
+      SystemGroupIDs[0] = 0;
+      NumSystemGroups   = 1;
+    }
+  }
 
  /*
   * Get the access control list for browsing...
@@ -1783,6 +1770,141 @@ parse_aaa(cupsd_location_t *loc,        /* I - Location */
 }
 
 
+/*
+ * 'parse_groups()' - Parse system group names in a string.
+ */
+
+static int                             /* O - 1 on success, 0 on failure */
+parse_groups(const char *s)            /* I - Space-delimited groups */
+{
+  int          status;                 /* Return status */
+  char         value[1024],            /* Value string */
+               *valstart,              /* Pointer into value */
+               *valend,                /* End of value */
+               quote;                  /* Quote character */
+  struct group *group;                 /* Group */
+
+
+ /*
+  * Make a copy of the string and parse out the groups...
+  */
+
+  strlcpy(value, s, sizeof(value));
+
+  status   = 1;
+  valstart = value;
+
+  while (*valstart && NumSystemGroups < MAX_SYSTEM_GROUPS)
+  {
+    if (*valstart == '\'' || *valstart == '\"')
+    {
+     /*
+      * Scan quoted name...
+      */
+
+      quote = *valstart++;
+
+      for (valend = valstart; *valend; valend ++)
+       if (*valend == quote)
+         break;
+    }
+    else
+    {
+     /*
+      * Scan space or comma-delimited name...
+      */
+
+      for (valend = valstart; *valend; valend ++)
+       if (isspace(*valend) || *valend == ',')
+         break;
+    }
+
+    if (*valend)
+      *valend++ = '\0';
+
+    group = getgrnam(valstart);
+    if (group)
+    {
+      cupsdSetString(SystemGroups + NumSystemGroups, valstart);
+      SystemGroupIDs[NumSystemGroups] = group->gr_gid;
+
+      NumSystemGroups ++;
+    }
+    else
+      status = 0;
+
+    endgrent();
+
+    valstart = valend;
+
+    while (*valstart == ',' || isspace(*valstart))
+      valstart ++;
+  }
+
+  return (status);
+}
+
+
+/*
+ * 'parse_protocols()' - Parse browse protocols in a string.
+ */
+
+static int                             /* O - Browse protocol bits */
+parse_protocols(const char *s)         /* I - Space-delimited protocols */
+{
+  int  protocols;                      /* Browse protocol bits */
+  char value[1024],                    /* Value string */
+       *valstart,                      /* Pointer into value */
+       *valend;                        /* End of value */
+
+
+ /*
+  * Loop through the value string,...
+  */
+
+  strlcpy(value, s, sizeof(value));
+
+  protocols = 0;
+
+  for (valstart = value; *valstart;)
+  {
+   /*
+    * Get the current space/comma-delimited protocol name...
+    */
+
+    for (valend = valstart; *valend; valend ++)
+      if (isspace(*valend & 255) || *valend == ',')
+       break;
+
+    if (*valend)
+      *valend++ = '\0';
+
+   /*
+    * Add the protocol to the bitmask...
+    */
+
+    if (!strcasecmp(valstart, "cups"))
+      protocols |= BROWSE_CUPS;
+    else if (!strcasecmp(valstart, "slp"))
+      protocols |= BROWSE_SLP;
+    else if (!strcasecmp(valstart, "ldap"))
+      protocols |= BROWSE_LDAP;
+    else if (!strcasecmp(valstart, "dnssd") || !strcasecmp(valstart, "bonjour"))
+      protocols |= BROWSE_DNSSD;
+    else if (!strcasecmp(valstart, "all"))
+      protocols |= BROWSE_ALL;
+    else
+      return (-1);
+
+    for (valstart = valend; *valstart; valstart ++)
+      if (!isspace(*valstart & 255) || *valstart != ',')
+       break;
+  }
+
+  return (protocols);
+}
+
+
 /*
  * 'read_configuration()' - Read a configuration file.
  */
@@ -1800,8 +1922,7 @@ read_configuration(cups_file_t *fp)       /* I - File to read from */
                                        /* Temporary buffer 2 for value */
                        *ptr,           /* Pointer into line/temp */
                        *value,         /* Pointer to value */
-                       *valueptr,      /* Pointer into value */
-                       quote;          /* Quote character */
+                       *valueptr;      /* Pointer into value */
   int                  valuelen;       /* Length of value */
   cupsd_var_t          *var;           /* Current variable */
   http_addrlist_t      *addrlist,      /* Address list */
@@ -2115,66 +2236,25 @@ read_configuration(cups_file_t *fp)     /* I - File to read from */
              !strcasecmp(line, "BrowseRemoteProtocols"))
     {
      /*
-      * "BrowseProtocol name [... name]"
+      * "BrowseProtocols name [... name]"
+      * "BrowseLocalProtocols name [... name]"
+      * "BrowseRemoteProtocols name [... name]"
       */
 
-      if (strcasecmp(line, "BrowseLocalProtocols"))
-        BrowseRemoteProtocols = 0;
-      if (strcasecmp(line, "BrowseRemoteProtocols"))
-        BrowseLocalProtocols = 0;
+      int protocols = parse_protocols(value);
 
-      for (; *value;)
+      if (protocols < 0)
       {
-        for (valuelen = 0; value[valuelen]; valuelen ++)
-         if (isspace(value[valuelen]) || value[valuelen] == ',')
-           break;
-
-        if (value[valuelen])
-        {
-         value[valuelen] = '\0';
-         valuelen ++;
-       }
-
-        if (!strcasecmp(value, "cups"))
-       {
-         if (strcasecmp(line, "BrowseLocalProtocols"))
-           BrowseRemoteProtocols |= BROWSE_CUPS;
-         if (strcasecmp(line, "BrowseRemoteProtocols"))
-           BrowseLocalProtocols |= BROWSE_CUPS;
-       }
-        else if (!strcasecmp(value, "slp"))
-       {
-         if (strcasecmp(line, "BrowseLocalProtocols"))
-           BrowseRemoteProtocols |= BROWSE_SLP;
-         if (strcasecmp(line, "BrowseRemoteProtocols"))
-           BrowseLocalProtocols |= BROWSE_SLP;
-       }
-        else if (!strcasecmp(value, "ldap"))
-       {
-         if (strcasecmp(line, "BrowseLocalProtocols"))
-           BrowseRemoteProtocols |= BROWSE_LDAP;
-         if (strcasecmp(line, "BrowseRemoteProtocols"))
-           BrowseLocalProtocols |= BROWSE_LDAP;
-       }
-        else if (!strcasecmp(value, "all"))
-       {
-         if (strcasecmp(line, "BrowseLocalProtocols"))
-           BrowseRemoteProtocols |= BROWSE_ALL;
-         if (strcasecmp(line, "BrowseRemoteProtocols"))
-           BrowseLocalProtocols |= BROWSE_ALL;
-       }
-       else
-       {
-         cupsdLogMessage(CUPSD_LOG_ERROR,
-                         "Unknown browse protocol \"%s\" on line %d.",
-                         value, linenum);
-          break;
-       }
-
-        for (value += valuelen; *value; value ++)
-         if (!isspace(*value) || *value != ',')
-           break;
+       cupsdLogMessage(CUPSD_LOG_ERROR,
+                       "Unknown browse protocol \"%s\" on line %d.",
+                       value, linenum);
+        break;
       }
+
+      if (strcasecmp(line, "BrowseLocalProtocols"))
+        BrowseRemoteProtocols = protocols;
+      if (strcasecmp(line, "BrowseRemoteProtocols"))
+        BrowseLocalProtocols = protocols;
     }
     else if (!strcasecmp(line, "BrowseAllow") ||
              !strcasecmp(line, "BrowseDeny"))
@@ -2592,60 +2672,13 @@ read_configuration(cups_file_t *fp)     /* I - File to read from */
     else if (!strcasecmp(line, "SystemGroup"))
     {
      /*
-      * System (admin) group(s)...
+      * SystemGroup (admin) group(s)...
       */
 
-      for (i = NumSystemGroups; *value && i < MAX_SYSTEM_GROUPS;)
-      {
-        if (*value == '\'' || *value == '\"')
-       {
-        /*
-         * Scan quoted name...
-         */
-
-         quote = *value++;
-
-         for (valueptr = value; *valueptr; valueptr ++)
-           if (*valueptr == quote)
-             break;
-       }
-       else
-       {
-        /*
-         * Scan space or comma-delimited name...
-         */
-
-          for (valueptr = value; *valueptr; valueptr ++)
-           if (isspace(*valueptr) || *valueptr == ',')
-             break;
-        }
-
-        if (*valueptr)
-          *valueptr++ = '\0';
-
-        group = getgrnam(value);
-        if (group)
-       {
-          cupsdSetString(SystemGroups + i, value);
-         SystemGroupIDs[i] = group->gr_gid;
-
-         i ++;
-       }
-       else
-         cupsdLogMessage(CUPSD_LOG_ERROR,
-                         "Unknown SystemGroup \"%s\" on line %d, ignoring!",
-                         value, linenum);
-
-        endgrent();
-
-        value = valueptr;
-
-        while (*value == ',' || isspace(*value))
-         value ++;
-      }
-
-      if (i)
-        NumSystemGroups = i;
+      if (!parse_groups(value))
+       cupsdLogMessage(CUPSD_LOG_ERROR,
+                       "Unknown SystemGroup \"%s\" on line %d, ignoring!",
+                       value, linenum);
     }
     else if (!strcasecmp(line, "HostNameLookups"))
     {
index de93554722e66ee0140a5a8a666225930fc96b0f..50858a921b477d770b589679abf4596042ea3286 100755 (executable)
@@ -59,11 +59,14 @@ rm -rf tools
 cd ..
 
 echo -n Archiving...gz
-tar czf cups-$version-r$rev-source.tar.gz cups-$version
+tar czf cups-$fileversion-source.tar.gz cups-$version
 echo -n ...bz2
-tar cjf cups-$version-r$rev-source.tar.bz2 cups-$version
+tar cjf cups-$fileversion-source.tar.bz2 cups-$version
 echo "..."
 
+echo Removing temporary files...
+rm -rf cups-$version
+
 echo "Done!"
 
 #