1 ;;; package-net-packages.el --- Installation and Maintenance of XEmacs packages
3 ;; Copyright (C) 2000 Andy Piper.
7 ;; This file is part of XEmacs.
9 ;; XEmacs is free software; you can redistribute it and/or modify it
10 ;; under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; XEmacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
21 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 ;;; Synched up with: Not in FSF
28 ;; Manipulate packages for the netinstall setup utility
30 ;; The process should be so:
32 ;; 1. The package maintainer or release manager makes a release
35 ;; 2. For a new package releases the netinstall maintainer simply
36 ;; needs to update `ftp://ftp.xemacs.org/pub/xemacs/setup.ini'. This is
37 ;; harder than it sounds because the file also includes information
38 ;; about the binary releases. At the moment going to the netinstall
39 ;; directory and typing:
41 ;; `make XEMACS=<current executable location> setup.ini'
43 ;; will do the right thing provided that:
45 ;; (a) `package-net-cygwin32-binary-size' and
46 ;; `package-net-win32-binary-size' are set correctly.
48 ;; (b) The binary pointed to by `XEMACS' has a current
49 ;; `package-index.LATEST.pgp' file. If you don't specify the XEMACS=
50 ;; part then you will get whatever is current for your build tree -
51 ;; which is probably not what you want.
53 ;; You can run `package-net-convert-index-to-ini' manually and specify
54 ;; REMOTE but I generally found that to be inconvenient and error-prone.
56 ;; 3. For package releases that's all you need to do. For binary
57 ;; releases you need to build both cygwin and win32 binaries and put
58 ;; them in appropriate tarballs:
60 ;; For cygwin, configure, make and install and then do (this is for
64 ;; tar cvzf xemacs-i686-pc-cygwin32-21.1.13.tar.gz \
65 ;; ./bin/i686-pc-cygwin32 ./lib/xemacs-21.1.13 \
66 ;; ./lib/xemacs/lock ./man/man1/xemacs.1 \
67 ;; ./man/man1/ctags.1 ./man/man1/gnu*.1'
69 ;; Note that the naming of the package is important. Don't be tempted
70 ;; to change the order in any way.
72 ;; For win32 build and install the release and then (again for
76 ;; tar cvzf xemacs-i386-pc-win32-21.1.13.tar.gz ./XEmacs-21.1.13
78 ;; The binaries should be uploaded to
79 ;; `ftp://ftp.xemacs.org/pub/xemacs/binaries/cygwin32' and
80 ;; `ftp://ftp.xemacs.org/pub/xemacs/binaries/win32' respectively. Take
81 ;; a note of their sizes and set `package-net-cygwin32-binary-size'
82 ;; and `package-net-win32-binary-size' appropriately in this file and
83 ;; then follow step 2.
85 (require 'package-admin)
86 (require 'package-get)
88 ;; What path should we use from the myriad available?
89 ;; For netinstall we just want something simple, and anyway this is only to
90 ;; bootstrap the process. This will be:
91 ;; <root>/setup/ for native windows
92 ;; <root>/lib/xemacs/setup for cygwin.
96 ;; 1. Package update functions should also update the installed
97 ;; database so that running setup.exe again does not reinstall
100 ;; 2. Generating setup.ini should be more automatic.
102 (defun package-net-packages-convert-index-to-ini (&optional destdir remote category)
103 "Convert the package index to ini file format in DESTDIR.
104 DESTDIR defaults to the value of `data-directory'."
105 ; (package-get-require-base remote)
107 (setq destdir (file-name-as-directory (or destdir data-directory)))
108 (let* ((fname "setup-packages.ini")
109 (buf (get-buffer-create (format "*%s*" fname))))
114 (goto-char (point-min))
115 (let ((entries package-get-base) entry plist)
116 (insert "# This file is automatically generated. If you edit it, your\n")
117 (insert "# edits will be discarded next time the file is generated.\n")
119 (insert (format "# package index version %s.\n" "unknown"))
122 (setq entry (car entries))
123 (setq plist (car (cdr entry)))
124 ;; ignore mule packages
125 (unless (or (memq 'mule-base (plist-get plist 'requires))
126 (eq 'mule-base (car entry)))
127 (insert (format "@ %s\n" (symbol-name (car entry))))
128 (insert (format "version: %s\n" (plist-get plist 'version)))
129 (insert (format "install: packages/%s %s\n" (plist-get plist 'filename)
130 (plist-get plist 'size)))
131 ;; These are not supported as yet
133 ;; (insert (format "source: %s\n" (plist-get plist 'source)))
134 ;; (insert "[prev]\n")
135 ;; (insert (format "version: %s\n" (plist-get plist 'version)))
136 ;; (insert (format "install: %s\n" (plist-get plist 'filename)))
137 ;; (insert (format "source: %s\n" (plist-get plist 'source)))
139 (setq entries (cdr entries))))
140 (insert (format "# %s file ends here\n" fname))
141 (write-region (point-min) (point-max) (concat destdir fname)))
144 (defun package-net-packages-batch-convert-index-to-ini ()
145 "Convert the package index to ini file format."
146 (unless noninteractive
147 (error "`package-net-packages-batch-convert-index-to-ini' is to be used only with -batch"))
148 (let ((dir (pop command-line-args-left))
149 (category (pop command-line-args-left))
150 (package-get-require-signed-base-updates nil))
151 (package-net-packages-convert-index-to-ini dir nil category)))
153 ;; package-net-packages.el ends here