├── .github └── workflows │ └── basic-check.yml ├── .gitignore ├── CHANGES.md ├── INSTALL.md ├── LICENSE ├── Makefile.in ├── README.md ├── aix.c ├── bsd.c ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── deb.c ├── default-256.png ├── default.icns ├── default.opacity ├── default.png ├── dist.c ├── doc ├── 1-intro.html ├── 2-building.html ├── 3-packaging.html ├── 4-advanced.html ├── 5-examples.html ├── Makefile.in ├── a-license.html ├── b-manpages.html ├── c-reference.html ├── epm-256.png ├── epm-book.book ├── epm-book.epub ├── epm-book.html ├── epm-book.pdf ├── epm.1 ├── epm.html ├── epm.list.5 ├── epm.list.man ├── epm.man ├── epminstall.1 ├── epminstall.html ├── epminstall.man ├── gradient.gif ├── mantohtml.c ├── mkepmlist.1 ├── mkepmlist.html ├── mkepmlist.man ├── preface.html ├── setup.1 ├── setup.html ├── setup.man ├── setup.png ├── setup.types.5 ├── setup.types.man ├── title.html ├── title.opacity └── title.png ├── epm.c ├── epm.h ├── epm.list.in ├── epminstall.c ├── epmstring.h ├── file.c ├── gui-common.cxx ├── gui-common.h ├── inst.c ├── install-sh ├── jimjag.patch ├── macos.c ├── makesrcdist ├── mkepmlist.c ├── pkg.c ├── portable.c ├── qprintf.c ├── rpm.c ├── run.c ├── setld.c ├── setup.cxx ├── setup.fl ├── setup.h ├── setup2.cxx ├── slackware.c ├── snprintf.c ├── string.c ├── support.c ├── swinstall.c ├── tar.c ├── uninst.cxx ├── uninst.fl ├── uninst.h └── uninst2.cxx /.github/workflows/basic-check.yml: -------------------------------------------------------------------------------- 1 | name: EPM-basic-check 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - run: ./configure 17 | - run: make 18 | - run: make test 19 | - run: make distclean 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Don't need the OS's leftovers. 2 | **/.DS_Store 3 | 4 | #IDE 5 | /.project 6 | /.cproject 7 | 8 | # Targets build by the configure phase 9 | /Makefile 10 | /autom4te.cache 11 | /config.h 12 | /config.log 13 | /config.status 14 | /doc/Makefile 15 | 16 | # Tool(s) built to facilitate the building of the product 17 | /doc/mantohtml 18 | 19 | # Actual targets build for distribution 20 | /epm 21 | /epm.list 22 | /epminstall 23 | /mkepmlist 24 | /setup 25 | /uninst 26 | 27 | # Flotsam left by the make process 28 | *.o 29 | *.a 30 | 31 | # Actual "outputs" of the building of package EPM for distribution. 32 | /linux-* 33 | /macos-* 34 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | Changes in EPM 2 | ============== 3 | 4 | Changes in EPM 5.0.0 5 | -------------------- 6 | 7 | - Enabling the GUI correctly checks for FLTK 8 | - The Apache OpenOffice specific changes are no longer configure-time 9 | (buildtime) enabled, but run time, via the --aoo-mode CLI option. 10 | - Relicensed to the ALv2 (via copyright holder) 11 | 12 | Changes in EPM 4.5.2 13 | -------------------- 14 | 15 | - Use `fakeroot` if available when building DEB packages to ensure 16 | correct file permissions 17 | - Support `rpmbuild` for RHEL7 and similar platforms 18 | - Brought back support for platforms deprecated in 4.5.0 19 | 20 | Changes in EPM 4.5.1 21 | -------------------- 22 | 23 | - Fixed Debian dependencies for min/max version (Issue #64) 24 | - Fixed a typo in the epm.list file (Issue #78) 25 | - Fixed macro usage in the setup.types man page (Issue #81) 26 | - Fixed @INSTALL@ macro in makefile (Issue #84) 27 | - Fixed Debian init script support (Issue #85) 28 | 29 | 30 | Changes in EPM 4.5 31 | ------------------ 32 | 33 | - "make install" failed due to the README filename changing (Issue #59) 34 | - The `mkepmlist` utility did not correctly handle filenames containing the 35 | `$` character (Issue #62) 36 | - The configure script incorrectly substituted "NONE" for the installation 37 | prefix (Issue #67) 38 | - Fixed some over-zealous permissions on temporary build directories (Issue #71) 39 | - Fixed the mantohtml helper program - was depending on private CUPS headers for 40 | some reason (Issue #72) 41 | - Fixed some build system issues (Issue #75, Issue #76) 42 | - Documentation updates (Issue #74, Issue #77) 43 | - Cleaned up old sprintf and strcpy usage in many places. 44 | 45 | Changes in EPM 4.4.2 46 | -------------------- 47 | 48 | - Support Apache OpenOffice patches (at configure time) 49 | 50 | Changes in EPM 4.4.1 51 | -------------------- 52 | 53 | - "make install" failed due to the README filename changing (Issue #59) 54 | - The `mkepmlist` utility did not correctly handle filenames containing the 55 | `$` character (Issue #62) 56 | - The configure script incorrectly substituted "NONE" for the installation 57 | prefix (Issue #67) 58 | - Cleaned up old sprintf and strcpy usage in many places. 59 | 60 | 61 | Changes in EPM 4.4 62 | ------------------ 63 | 64 | - The default prefix is now the usual `/usr/local` (Issue #45) 65 | - Really fix 64-bit Intel packages on Debian-based OS's (Issue #48) 66 | - Fixed a build issue on Solaris 11 (Issue #50) 67 | - Fixed a bug in temporary file cleanup when symlinks are used (Issue #51) 68 | - Added DESTDIR support to makefiles (Issue #55) 69 | - Fixed RPM support on AIX (Issue #56) 70 | - Reverted the hard links optimization from EPM 4.2 since it is causing 71 | problems with the latest version of RPM (Issue #57) 72 | - Packages on macOS now use "macos" as the operating system name for 73 | consistency. 74 | 75 | 76 | Changes in EPM 4.3 77 | ------------------ 78 | 79 | - Now use pkgbuild on newer versions of macOS, and added support for signed 80 | packages (Bug #497) 81 | - Fixed some file handling issues when creating RPM packages (Bug #523) 82 | - EPM now maps the x86_64 architecture to amd64 when creating Debian packages 83 | (Bug #295) 84 | - %format stopped working in EPM 4.2 (Bug #296) 85 | - %literal(spec) did not insert the literal content in the correct location 86 | (Bug #302) 87 | - Fixed some incorrect string handling (Bug #290) 88 | - Fixed a compatibility issue with RPM 4.8 (Bug #292) 89 | - Fixed a build dependency problem (Bug #291) 90 | - The EPM makefile now uses CPPFLAGS from the configure script (Bug #300) 91 | - Updated the standard path used by portable package scripts to include 92 | /usr/gnu/bin for Solaris (Bug #301) 93 | - Added support for %literal(control) in Debian packages (Bug #297) 94 | 95 | 96 | Changes in EPM 4.2 97 | ------------------ 98 | 99 | - EPM now supports a %arch conditional directive (STR #27) 100 | - EPM now uses hard links whenever possible instead of copying files for 101 | distribution (STR #21) 102 | - EPM no longer puts files in /export in the root file set for AIX packages 103 | (STR #15) 104 | - EPM did not work with newer versions of RPM (STR #23, STR #25) 105 | - EPM did not clean up temporary files from Solaris packages (STR #20) 106 | - Building Solaris gzip'd packages failed if the pkg.gz file already existed 107 | (STR #16) 108 | - Fixed handling of %preremove and %postremove for AIX packages (STR #22) 109 | - Fixed directory permissions in HP-UX packages (STR #24) 110 | - Removed unnecessary quoting of "!" in filenames (STR #26) 111 | - Added support for signed RPM packages (STR #19) 112 | - Added support for inclusion of format-specific packaging files and directives 113 | via a %literal directive (STR #5) 114 | - *BSD init scripts were not installed properly. 115 | - EPM now displays a warning message when a variable is undefined (STR #10) 116 | - *BSD dependencies on versioned packages are now specified correctly (STR #4) 117 | - EPM now uses /usr/sbin/pkg_create on FreeBSD (STR #2) 118 | - FreeBSD packages are now created with a .tbz extension (STR #1) 119 | - FreeBSD packages incorrectly assumed that chown was installed in /bin (STR #3) 120 | - Added support for an "lsb" package format which uses RPM with the LSB 121 | dependencies (STR #7) 122 | - The configure script now supports a --with-archflags and no longer 123 | automatically builds universal binaries on macOS. 124 | - The epm program now automatically detects when the setup GUI is not available, 125 | displays a warning message, and then creates a non-GUI package. 126 | - RPM packages did not map %replaces to Obsoletes: 127 | 128 | 129 | Changes in EPM 4.1 130 | ------------------ 131 | 132 | - macOS portable packages did not create a correct Uninstall application. 133 | - The temporary package files for portable packages are now removed after 134 | creation of the .tar.gz file unless the -k (keep files) option is used. 135 | - The RPM summary string for subpackages did not contain the first line of the 136 | package description as for other package formats. 137 | - The setup and uninst GUIs now support installing and removing RPM packages. 138 | - The setup GUI now confirms acceptance of all licenses prior to installing the 139 | first package. 140 | - Subpackages are no longer automatically dependent on the main package. 141 | - Multi-line descriptions were not embedded properly into portable package 142 | install/patch/remove scripts. 143 | - Updated the setup and uninstall GUIs for a nicer look-n-feel. 144 | - macOS portable packages now show the proper name, version, and copyright 145 | for the packaged software instead of the EPM version and copyright. 146 | - Fixed a problem with creation of macOS metapackages with the latest Xcode. 147 | - EPM now removes the individual .rpm and .deb files when 148 | creating a package with subpackages unless the -k option (keep files) is used. 149 | - EPM now only warns about package names containing characters other than 150 | letters and numbers. 151 | - EPM now generates disk images as well as a .tar.gz file when creating portable 152 | packages on macOS. 153 | 154 | 155 | Changes in EPM 4.0 156 | ------------------ 157 | 158 | - New subpackage support for creating multiple dependent packages or a combined 159 | package with selectable subpackages, depending on the package format. 160 | - Added support for compressing the package files in portable packages which 161 | reduces disk space requirements on platforms that provide gzip. 162 | - Added support for custom platform names via the new `-m name` option. 163 | - Added support for non-numeric %release values. 164 | - Added new `--depend` option to list all of the source files that a package 165 | depends on. 166 | - The setup GUI now sets the `EPM_INSTALL_TYPE` environment variable to the 167 | value of the selected TYPE line in the `setup.types` file. 168 | - Fixed NetBSD and OpenBSD packaging support by no longer using FreeBSD-specific 169 | extensions to pkg_create on those variants. 170 | - Fixed PowerPC platform support for RPM and Debian packages. 171 | - Many fixes to AIX package support. 172 | - Tru64 packages with init scripts now work when installing for the first time. 173 | - RPM file dependencies should now work properly. 174 | - Portable product names containing spaces will now display properly. 175 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | How to Install EPM 2 | ================== 3 | 4 | > Note: Complete installation instructions can be found in the file 5 | > `doc/epm-book.html`. 6 | 7 | 8 | What is Required for EPM? 9 | ------------------------- 10 | 11 | On your development system you just need a C compiler, a make program, a POSIX 12 | shell (Bourne, Korn, Bash, etc.), and gzip. 13 | 14 | The graphical setup program needs a C++ compiler and the FLTK library, version 15 | 1.1.x or 1.3.x, available at . 16 | 17 | EPM can generate so-called "portable" distributions that are based on shell 18 | scripts and tar files. For these types of distributions your customers/users 19 | will need a POSIX shell (Bourne, Korn, Bash, etc.), a tar program, and gzip. 20 | The first two are standard items, and gzip is being shipped by most vendors as 21 | well. 22 | 23 | EPM can also generate vendor-specific distributions. These require the 24 | particular vendor tool (rpm, dpkg, etc.) to load the software. 25 | 26 | 27 | How Do I Compile EPM? 28 | --------------------- 29 | 30 | EPM uses GNU autoconf to configure itself for your system. To build it, use: 31 | 32 | ./configure 33 | make 34 | 35 | The default installation prefix is `/usr/local`; if you want to put EPM in a 36 | different location, use the `--prefix` option to the configure script: 37 | 38 | ./configure --prefix=/path/to/use 39 | make 40 | 41 | To test that the build was OK, you can use the following: 42 | 43 | make test 44 | 45 | Once EPM is compiled and you are sure it is working, you can type: 46 | 47 | sudo make install 48 | 49 | to install the software. 50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for the ESP Package Manager (EPM). 3 | # 4 | # Copyright © 2020 by Jim Jagielski 5 | # Copyright © 1999-2020 by Michael R Sweet 6 | # Copyright © 1999-2010 by Easy Software Products, all rights reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | # Programs... 22 | AR = @AR@ 23 | CC = @CC@ 24 | CHMOD = @CHMOD@ 25 | CODE_SIGN = @CODE_SIGN@ 26 | CP = @CP@ 27 | CXX = @CXX@ 28 | FLTKCONFIG = @FLTKCONFIG@ 29 | INSTALL = @INSTALL@ 30 | MKDIR = @MKDIR@ -p 31 | RANLIB = @RANLIB@ 32 | RM = @RM@ -f 33 | SHELL = /bin/sh 34 | STRIP = @STRIP@ 35 | 36 | 37 | # Program options... 38 | ARFLAGS = @ARFLAGS@ 39 | ARCHFLAGS = @ARCHFLAGS@ 40 | ASAN_OPTIONS = leak_check_at_exit=false 41 | CFLAGS = $(ARCHFLAGS) @CFLAGS@ $(OPTIM) 42 | CODESIGN_IDENTITY = Developer ID 43 | CPPFLAGS = @CPPFLAGS@ 44 | CSFLAGS = -s "$(CODESIGN_IDENTITY)" --timestamp @CSFLAGS@ 45 | CXXFLAGS = $(ARCHFLAGS) @CXXFLAGS@ $(OPTIM) 46 | GUILIBS = @GUILIBS@ 47 | LDFLAGS = $(ARCHFLAGS) @LDFLAGS@ $(OPTIM) 48 | LIBS = @LIBS@ 49 | OPTIM = @OPTIM@ 50 | 51 | 52 | # Directories... 53 | bindir = @bindir@ 54 | datadir = @datadir@ 55 | datarootdir = @datarootdir@ 56 | exec_prefix = @exec_prefix@ 57 | includedir = @includedir@ 58 | infodir = @infodir@ 59 | libdir = @libdir@ 60 | libexecdir = @libexecdir@ 61 | localstatedir = @localstatedir@ 62 | mandir = @mandir@ 63 | oldincludedir = @oldincludedir@ 64 | prefix = @prefix@ 65 | privateinclude = @privateinclude@ 66 | sbindir = @sbindir@ 67 | sharedstatedir = @sharedstatedir@ 68 | srcdir = @srcdir@ 69 | sysconfdir = @sysconfdir@ 70 | top_srcdir = @top_srcdir@ 71 | 72 | BUILDROOT = $(DSTROOT)$(RPM_BUILD_ROOT)$(DESTDIR) 73 | VPATH = $(srcdir) 74 | 75 | 76 | # Rules... 77 | .SILENT: 78 | 79 | .SUFFIXES: .c .cxx .h .o 80 | .c.o: 81 | echo Compiling $<... 82 | $(CC) $(CFLAGS) $(CPPFLAGS) -I. -I$(srcdir) -c $< 83 | .cxx.o: 84 | echo Compiling $<... 85 | $(CXX) $(CXXFLAGS) $(CPPFLAGS) -I. -I$(srcdir) -c $< 86 | 87 | 88 | # Targets... 89 | TARGETS = libepm.a \ 90 | epm \ 91 | epminstall \ 92 | mkepmlist \ 93 | @GUIS@ 94 | EPM_OBJS = aix.o \ 95 | bsd.o \ 96 | deb.o \ 97 | dist.o \ 98 | file.o \ 99 | inst.o \ 100 | macos.o \ 101 | pkg.o \ 102 | portable.o \ 103 | qprintf.o \ 104 | rpm.o \ 105 | run.o \ 106 | setld.o \ 107 | slackware.o \ 108 | snprintf.o \ 109 | string.o \ 110 | support.o \ 111 | swinstall.o \ 112 | tar.o 113 | SETUP_OBJS = setup.o \ 114 | setup2.o \ 115 | gui-common.o 116 | UNINST_OBJS = uninst.o \ 117 | uninst2.o \ 118 | gui-common.o 119 | OBJS = epm.o \ 120 | $(EPM_OBJS) \ 121 | epminstall.o \ 122 | mkepmlist.o \ 123 | $(SETUP_OBJS) \ 124 | $(UNINST_OBJS) 125 | 126 | 127 | # Make all targets... 128 | all: $(TARGETS) Makefile config.h 129 | 130 | 131 | # Clean all generated files... 132 | clean: 133 | $(RM) $(OBJS) 134 | $(RM) $(TARGETS) 135 | 136 | 137 | # Clean all generated and configuration files... 138 | distclean: 139 | $(RM) $(OBJS) 140 | $(RM) $(TARGETS) 141 | $(RM) config.cache config.h config.log config.status 142 | $(RM) Makefile doc/Makefile 143 | $(RM) epm.list 144 | 145 | 146 | # 147 | # Run the clang.llvm.org static code analysis tool on the C sources. 148 | # 149 | 150 | .PHONY: clang clang-changes 151 | clang: 152 | $(RM) -r clang 153 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all 154 | clang-changes: 155 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all 156 | 157 | 158 | # Install all targets... 159 | install: all @INSTALL_GUIS@ @INSTALL_OSX@ 160 | echo Installing EPM programs in $(BUILDROOT)$(bindir) 161 | $(INSTALL) -d -m 755 $(BUILDROOT)$(bindir) 162 | for file in epm epminstall mkepmlist; do \ 163 | $(INSTALL) -c -m 755 $$file $(BUILDROOT)$(bindir); \ 164 | done 165 | (cd doc; $(MAKE) $(MFLAGS) install) 166 | 167 | install-guis: setup uninst 168 | echo Installing EPM setup/uninst in $(BUILDROOT)$(libdir)/epm 169 | $(INSTALL) -d -m 755 $(BUILDROOT)$(libdir)/epm 170 | for file in setup uninst; do \ 171 | $(INSTALL) -c -m 755 $$file $(BUILDROOT)$(libdir)/epm; \ 172 | done 173 | 174 | install-macos: 175 | echo Installing EPM macOS data files in $(BUILDROOT)$(datadir)/epm 176 | $(INSTALL) -d -m 755 $(BUILDROOT)$(datadir)/epm 177 | $(INSTALL) -c -m 644 default.icns $(BUILDROOT)$(datadir)/epm 178 | 179 | 180 | # Uninstall all targets... 181 | uninstall: 182 | echo Uninstalling EPM programs from $(BUILDROOT)$(bindir) 183 | $(RM) $(BUILDROOT)$(bindir)/epm 184 | $(RM) $(BUILDROOT)$(bindir)/epminstall 185 | $(RM) $(BUILDROOT)$(bindir)/mkepmlist 186 | echo Uninstalling EPM setup/uninstall from $(BUILDROOT)$(libdir)/epm 187 | $(RM) -r $(BUILDROOT)$(libdir)/epm 188 | echo Uninstalling EPM macOS data files from $(BUILDROOT)$(datadir)/epm 189 | $(RM) -r $(BUILDROOT)$(datadir)/epm 190 | 191 | 192 | # Makefile 193 | Makefile: Makefile.in configure 194 | if test -f config.status; then \ 195 | ./config.status --recheck; \ 196 | ./config.status; \ 197 | else \ 198 | ./configure; \ 199 | fi 200 | touch config.h 201 | 202 | 203 | # config.h 204 | config.h: config.h.in configure 205 | if test -f config.status; then \ 206 | ./config.status --recheck; \ 207 | ./config.status; \ 208 | else \ 209 | ./configure; \ 210 | fi 211 | touch config.h 212 | 213 | 214 | # Test EPM... 215 | test: $(TARGETS) 216 | echo Starting portable distribution build test... 217 | if ./epm -vv epm >test.log; then \ 218 | echo Portable distribution build test PASSED.; \ 219 | else \ 220 | echo Portable distribution build test FAILED.; \ 221 | cat test.log; \ 222 | fi 223 | echo Starting native distribution build test... 224 | if ./epm -vv -s default.png -f native \ 225 | --setup-program setup --uninstall-program uninst \ 226 | epm >test.log; then \ 227 | echo Native distribution build test PASSED.; \ 228 | else \ 229 | echo Native distribution build test FAILED.; \ 230 | cat test.log; \ 231 | fi 232 | $(RM) test.log 233 | 234 | 235 | # Make distributions in different formats using EPM... 236 | aix: $(TARGETS) 237 | ./epm -f aix -v epm 238 | 239 | bsd: $(TARGETS) 240 | ./epm -f bsd -v epm 241 | 242 | slackware: $(TARGETS) 243 | ./epm -f slackware -v epm 244 | 245 | deb: $(TARGETS) 246 | ./epm -f deb -v epm 247 | 248 | inst tardist: $(TARGETS) 249 | ./epm -f tardist -v epm 250 | 251 | gui: $(TARGETS) 252 | ./epm -f portable -v -s default.png --setup-program setup \ 253 | --uninstall-program uninst --data-dir . epm 254 | 255 | lsb macos portable rpm: $(TARGETS) 256 | ./epm -f $@ -v -s default.png --setup-program setup \ 257 | --uninstall-program uninst --data-dir . epm 258 | 259 | pkg: $(TARGETS) 260 | ./epm -f pkg -v epm 261 | 262 | native: $(TARGETS) 263 | ./epm -f native -v epm 264 | 265 | swinstall depot: $(TARGETS) 266 | ./epm -f depot -v epm 267 | 268 | # libepm.a 269 | libepm.a: $(EPM_OBJS) 270 | echo Archiving libepm.a... 271 | $(RM) libepm.a 272 | $(AR) $(ARFLAGS) libepm.a $(EPM_OBJS) 273 | $(RANLIB) libepm.a 274 | 275 | $(EPM_OBJS): epm.h epmstring.h 276 | 277 | 278 | # epm 279 | epm: epm.o libepm.a 280 | echo Linking epm... 281 | $(CC) $(LDFLAGS) -o epm epm.o libepm.a $(LIBS) 282 | #echo Code signing $@... 283 | #$(CODE_SIGN) $(CSFLAGS) -i com.jimjag.epm.$@ $@ 284 | 285 | epm.o: epm.h epmstring.h 286 | 287 | 288 | # epminstall 289 | epminstall: epminstall.o libepm.a 290 | echo Linking epminstall... 291 | $(CC) $(LDFLAGS) -o epminstall epminstall.o libepm.a $(LIBS) 292 | #echo Code signing $@... 293 | #$(CODE_SIGN) $(CSFLAGS) -i com.jimjag.epm.$@ $@ 294 | 295 | epminstall.o: epm.h epmstring.h 296 | 297 | 298 | # mkepmlist 299 | mkepmlist: mkepmlist.o libepm.a 300 | echo Linking mkepmlist... 301 | $(CC) $(LDFLAGS) -o mkepmlist mkepmlist.o libepm.a $(LIBS) 302 | #echo Code signing $@... 303 | #$(CODE_SIGN) $(CSFLAGS) -i com.jimjag.epm.$@ $@ 304 | 305 | mkepmlist.o: epm.h epmstring.h 306 | 307 | 308 | # setup (GUI) 309 | setup: $(SETUP_OBJS) libepm.a 310 | echo Linking setup... 311 | $(CXX) $(LDFLAGS) -o setup $(SETUP_OBJS) libepm.a $(GUILIBS) $(LIBS) 312 | 313 | setup.o: setup.h gui-common.h epmstring.h 314 | setup2.o: setup.h gui-common.h epmstring.h 315 | gui-common.o: gui-common.h 316 | 317 | 318 | # uninst (GUI) 319 | uninst: $(UNINST_OBJS) libepm.a 320 | echo Linking uninst... 321 | $(CXX) $(LDFLAGS) -o uninst $(UNINST_OBJS) libepm.a $(GUILIBS) $(LIBS) 322 | 323 | uninst.o: uninst.h epmstring.h gui-common.h 324 | uninst2.o: uninst.h epmstring.h gui-common.h 325 | gui-common.o: gui-common.h 326 | 327 | 328 | # Common dependencies... 329 | $(OBJS): Makefile config.h 330 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ESP Package Manager (EPM) 2 | ========================= 3 | 4 | What is EPM? 5 | ------------ 6 | 7 | EPM is a simple cross-platform tool that generates software and patch 8 | distributions in various formats from a list of files. Supported formats 9 | include: 10 | 11 | - AIX software packages ("installp") 12 | - AT&T software packages ("pkgadd"), used by Solaris and others 13 | - BSD packages ("pkg_create") 14 | - Compaq Tru64 UNIX ("setld") 15 | - Debian Package Manager ("dpkg") 16 | - HP-UX software packages ("swinstall") 17 | - IRIX software manager ("inst", "swmgr", or "tardist") 18 | - macOS software packages ("name.pkg") 19 | - Portable (installation and removal scripts with tar files) 20 | - Red Hat Package Manager ("rpm") 21 | - Slackware software packages ("name.tgz") 22 | 23 | EPM also includes graphical "setup" and "uninstall" programs that can be 24 | provided with your distributions to make installation and removal of more than 25 | one package a snap. The installers can be customized with product logos, 26 | "readme" files, and click-wrap licenses as desired. 27 | 28 | EPM is provided as free software under version 2 of the Apache License (ALv2). 29 | 30 | How is this releated to the official EPM? 31 | ----------------------------------------- 32 | 33 | Starting with version 4.5.2, this is, in fact, the official EPM distribution. 34 | 35 | 36 | How Do I Compile EPM? 37 | --------------------- 38 | 39 | See the file `INSTALL.md` for more info on that. 40 | 41 | 42 | How Do I Use EPM? 43 | ----------------- 44 | 45 | Please look at the EPM manual. A preformatted copy is included with the source 46 | archive in the file `doc/epm-book.html`. 47 | 48 | An example EPM software list file is provided with this distribution in the 49 | file `epm.list`. 50 | 51 | 52 | Do I Have to Pay to Distribute Software Using EPM? 53 | -------------------------------------------------- 54 | 55 | No! EPM is free software and any installations you create are unencumbered by 56 | licensing of any kind, not even the GPL or the ALv2. 57 | 58 | 59 | What's New in EPM? 60 | ------------------ 61 | 62 | See the file `CHANGES.md` for change information. 63 | 64 | 65 | Resources 66 | --------- 67 | 68 | The official home page for EPM is . 69 | 70 | Report all problems and submit all patches/pull requests using the Github issue 71 | tracking pages at . 72 | 73 | 74 | Legal Stuff 75 | ----------- 76 | 77 | EPM is Copyright © 1999-2020 by Michael R Sweet. All rights reserved. 78 | EPM is Copyright © 2020 by Jim Jagielski. All rights reserved. 79 | 80 | Licensed under the Apache License, Version 2.0 (the "License"); 81 | you may not use this file except in compliance with the License. 82 | You may obtain a copy of the License at 83 | 84 | http://www.apache.org/licenses/LICENSE-2.0 85 | 86 | Unless required by applicable law or agreed to in writing, software 87 | distributed under the License is distributed on an "AS IS" BASIS, 88 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 89 | See the License for the specific language governing permissions and 90 | limitations under the License. 91 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Configuration file for the ESP Package Manager (EPM). 3 | * 4 | * Copyright 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2005 by Easy Software Products. 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2, or (at your option) 11 | * any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | */ 18 | 19 | /* 20 | * Version of software... 21 | */ 22 | 23 | #define EPM_VERSION "" 24 | 25 | 26 | /* 27 | * Where are files stored? 28 | */ 29 | 30 | #define EPM_SOFTWARE "/etc/software" 31 | 32 | 33 | /* 34 | * Where are binaries stored? 35 | */ 36 | 37 | #define EPM_BINDIR "/usr/bin" 38 | #define EPM_DATADIR "/usr/share/epm" 39 | #define EPM_LIBDIR "/usr/lib/epm" 40 | 41 | 42 | /* 43 | * What options does the strip command take? 44 | */ 45 | 46 | #define EPM_STRIP "/bin/strip" 47 | 48 | 49 | /* 50 | * What command is used to build RPMs? 51 | */ 52 | 53 | #define EPM_RPMBUILD "rpmbuild" 54 | 55 | 56 | /* 57 | * What option is used to specify the RPM architecture? 58 | */ 59 | 60 | #define EPM_RPMARCH "--target" 61 | 62 | 63 | /* 64 | * Does this version of RPM support the "topdir_" variable? 65 | */ 66 | 67 | #undef EPM_RPMTOPDIR 68 | 69 | 70 | /* 71 | * Compiler stuff... 72 | */ 73 | 74 | #undef const 75 | #undef __CHAR_UNSIGNED__ 76 | 77 | 78 | /* 79 | * Do we have the header file? 80 | */ 81 | 82 | #undef HAVE_STRINGS_H 83 | 84 | 85 | /* 86 | * Which header files do we use for the statfs() function? 87 | */ 88 | 89 | #undef HAVE_SYS_MOUNT_H 90 | #undef HAVE_SYS_STATFS_H 91 | #undef HAVE_SYS_VFS_H 92 | #undef HAVE_SYS_PARAM_H 93 | 94 | 95 | /* 96 | * Do we have the strXXX() functions? 97 | */ 98 | 99 | #undef HAVE_STRCASECMP 100 | #undef HAVE_STRDUP 101 | #undef HAVE_STRLCAT 102 | #undef HAVE_STRLCPY 103 | #undef HAVE_STRNCASECMP 104 | 105 | 106 | /* 107 | * Do we have the (v)snprintf() functions? 108 | */ 109 | 110 | #undef HAVE_SNPRINTF 111 | #undef HAVE_VSNPRINTF 112 | 113 | 114 | /* 115 | * Which directory functions and headers do we use? 116 | */ 117 | 118 | #undef HAVE_DIRENT_H 119 | #undef HAVE_SYS_DIR_H 120 | #undef HAVE_SYS_NDIR_H 121 | #undef HAVE_NDIR_H 122 | 123 | 124 | /* 125 | * Where is the "gzip" executable? 126 | */ 127 | 128 | #define EPM_GZIP "gzip" 129 | 130 | 131 | /* 132 | * Compress files by default? 133 | */ 134 | 135 | #define EPM_COMPRESS 0 136 | -------------------------------------------------------------------------------- /default-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/default-256.png -------------------------------------------------------------------------------- /default.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/default.icns -------------------------------------------------------------------------------- /default.opacity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/default.opacity -------------------------------------------------------------------------------- /default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/default.png -------------------------------------------------------------------------------- /doc/2-building.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

2 - Building EPM

5 | 6 |

This chapter shows how to configure, build, and install the 7 | ESP Package Manager.

8 | 9 |

Requirements

10 | 11 |

EPM requires very little pre-installed software to work. Most items will likely be provided as part of your OS. Your development system will need a C compiler, the make(1) program (GNU, BSD, and most vendor make programs should work), a POSIX shell (Bourne, Korn, Bash, etc.), and gzip(1).

12 | 13 |

The optional graphical setup program requires a C++ compiler, the FLTK library, version 1.1.x or 1.3.x, and (for UNIX/Linux) the X11 libraries. FLTK is available at the following URL:

14 | 15 |
 16 | http://www.fltk.org/
 17 | 
18 | 19 |

Your end-user systems will require a POSIX shell, the df(1) program, the tar(1) program, and the gzip(1) program to install portable distributions. All but the last are standard items, and most vendors include gzip as well.

20 | 21 |

EPM can also generate vendor-specific distributions. These require the particular vendor tool, such as rpm(8) and dpkg(8), to generate the software distribution on the development system and load the software distribution on the end-user system.

22 | 23 |

Configuring the Software

24 | 25 |

EPM uses GNU autoconf(1) to configure itself for your system. The configure script is used to configure the EPM software, as follows:

26 | 27 |
 28 | ./configure ENTER
 29 | 
30 | 31 |

Choosing Compilers

32 | 33 |

If the configure script is unable to determine the name of your C or C++ compiler, set the CC and CXX environment variables to point to the C and C++ compiler programs, respectively. You can set these variables using the following commands in the Bourne, Korn, or Bash shells:

34 | 35 |
 36 | export CC=/foo/bar/gcc ENTER
 37 | export CXX=/foo/bar/gcc ENTER
 38 | 
39 | 40 |

If you are using C shell or tcsh, use the following commands instead:

41 | 42 |
 43 | setenv CC /foo/bar/gcc ENTER
 44 | setenv CXX /foo/bar/gcc ENTER
 45 | 
46 | 47 |

Run the configure script again to use the new commands.

48 | 49 |

Choosing Installation Directories

50 | 51 |

The default installation prefix is /usr/local, which will place the EPM programs in /usr/local/bin, the setup GUI in /usr/local/lib/epm, and the man pages in /usr/local/share/man. Use the --prefix option to relocate these files to another directory:

52 | 53 |
 54 | ./configure --prefix=/example/path ENTER
 55 | 
56 | 57 |

The configure script also accepts the --bindir, --libdir, and --mandir options to relocate each directory separately, as follows: 58 | 59 |

 60 | ./configure --bindir=/example/path/bin --libdir=/example/path/lib \
 61 |     --mandir=/example/path/share/man ENTER
 62 | 
63 | 64 |

Options for the Setup GUI

65 | 66 |

The setup GUI requires the FLTK library. The configure script will look for the fltk-config utility that comes with FLTK. Set the FLTKCONFIG environment variable to the full path of this utility if it cannot be found in the current path:

67 | 68 |
 69 | setenv FLTKCONFIG /foo/bar/bin/fltk-config ENTER
 70 | 
71 | 72 |

or:

73 | 74 |
 75 | FLTKCONFIG=/foo/bar/bin/fltk-config ENTER
 76 | export FLTKCONFIG
 77 | 
78 | 79 |

Building the Software

80 | 81 |

Once you have configured the software, type the following command to compile it:

82 | 83 |
 84 | make ENTER
 85 | 
86 | 87 |

Compilation should take a few minutes at most. Then type the following command to determine if the software compiled successfully:

88 | 89 |
 90 | make test ENTER
 91 | Portable distribution build test PASSED.
 92 | Native distribution build test PASSED.
 93 | 
94 | 95 |

The test target builds a portable and native distribution of EPM and reports if the two distributions were generated successfully.

96 | 97 |

Installing the Software

98 | 99 |

Now that you have compiled and tested the software, you can install it using the make command or one of the distributions that was created. You should be logged in as the super-user unless you specified installation directories for which you have write permission. The su(8) command is usually sufficient to install software:

100 | 101 |
102 | su ENTER
103 | 
104 | 105 |

Operating systems such as macOS do not enable the root account by default. The sudo(8) command is used instead:

106 | 107 |
108 | sudo installation command ENTER
109 | 
110 | 111 | 112 |

Installing Using the make Command

113 | 114 |

Type the following command to install the EPM software using the make command:

115 | 116 |
117 | make install ENTER
118 | Installing EPM setup in /usr/local/lib/epm
119 | Installing EPM programs in /usr/local/bin
120 | Installing EPM manpages in /usr/local/share/man/man1
121 | Installing EPM documentation in /usr/local/share/doc/epm
122 | 
123 | 124 |

Use the sudo command to install on macOS:

125 | 126 |
127 | sudo make install ENTER
128 | Installing EPM setup in /usr/local/lib/epm
129 | Installing EPM programs in /usr/local/bin
130 | Installing EPM manpages in /usr/local/share/man/man1
131 | Installing EPM documentation in /usr/local/share/doc/epm
132 | 
133 | 134 |

Installing Using the Portable Distribution

135 | 136 |

The portable distribution can be found in a subdirectory named using the operating system, version, and architecture. For example, the subdirectory for a Linux 2.4.x system on an Intel-based system would be linux-2.4-intel. The subdirectory name is built from the following template:

137 | 138 |
139 | os-major.minor-architecture
140 | 
141 | 142 |

The os name is the common name for the operating system. Table 2.1 lists the abbreviations for most operating systems.

143 | 144 |

The major.minor string is the operating system version number. Any patch revision information is stripped from the version number, as are leading characters before the major version number. For example, HP-UX version B.11.11 will result in a version number string of 11.11.

145 | 146 |
147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 |
Table 2.1: Operating System Name Abbreviations
Operating SystemName
AIXaix
Compaq Tru64 UNIX
158 | Digital UNIX
159 | OSF/1
tru64
FreeBSDfreebsd
HP-UXhpux
IRIXirix
Linuxlinux
macOSosx
NetBSDnetbsd
OpenBSDopenbsd
Solarissolaris
195 | 196 | 197 |
198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 231 | 232 | 233 |
Table 2.2: Processor Architecture Abbreviations
Processor(s)Abbreviation
Compaq Alphaalpha
HP Precision Architecturehppa
INTEL 80x86intel
INTEL 80x86 w/64bit Extensionsx86_64
MIPS RISCmips
IBM Power PCpowerpc
SPARC
229 | MicroSPARC
230 | UltraSPARC
sparc
234 | 235 |

The architecture string identifies the target processor. Table 2.2 lists the supported processors.

236 | 237 |

Once you have determined the subdirectory containing the distribution, type the following commands to install EPM from the portable distribution:

238 | 239 |
240 | cd os-major.minor-architecture ENTER
241 | ./epm.install ENTER
242 | 
243 | 244 |

The software will be installed after answering a few yes/no questions.

245 | 246 |

Installing Using the Native Distribution

247 | 248 |

The test target also builds a distribution in the native operating system format, if supported. Table 2.3 lists the native formats for each supported operating system and the command to run to install the software.

249 | 250 | 251 |
252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 267 | 268 | 269 | 270 | 271 | 274 | 275 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 |
Table 2.3: Native Operating System Formats
Operating SystemFormatCommand
AIXaixinstallp -ddirectory epm
Compaq Tru64 UNIX
265 | Digital UNIX
266 | OSF/1
setldsetld -a directory
FreeBSD
272 | NetBSD
273 | OpenBSD
bsdcd directory
276 | pkg_add epm
HP-UXdepotswinstall -f directory
IRIXinstswmgr -f directory
Linuxrpmrpm -i directory/epm-4.1.rpm
macOSosxopen directory/epm-4.1.pkg
Solarispkgpkgadd -d directory epm
304 | 305 | 306 | 307 | -------------------------------------------------------------------------------- /doc/5-examples.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

5 - EPM Packaging Examples

5 | 6 |

This chapter shows how the EPM and CUPS software is packaged using 7 | EPM list files. The EPM list file example highlights the basic features 8 | of EPM, while the CUPS list file example shows the more advanced features 9 | of EPM.

10 | 11 |

Packaging the EPM Software

12 | 13 |

The EPM software comes with its own autoconf-generated 14 | epm.list file that is used to package and test EPM. 15 | The EPM package consists of the main package plus a 16 | "documentation" subpackage for the documentation files and a 17 | "man" subpackage for the man pages.

18 | 19 |

We start by defining variables for each of the autoconf directory 20 | variables:

21 | 22 |
 23 | $prefix=/usr
 24 | $exec_prefix=/usr
 25 | $bindir=${exec_prefix}/bin
 26 | $datadir=/usr/share
 27 | $docdir=${datadir}/doc/epm
 28 | $libdir=/usr/lib
 29 | $mandir=/usr/share/man
 30 | $srcdir=.
 31 | 
32 | 33 |

Then we provide the general product information that is 34 | required for all packages; notice the use of 35 | ${srcdir} to reference the LICENSE and README 36 | files:

37 | 38 |
 39 | %product ESP Package Manager
 40 | %copyright 1999-2020 by Michael R Sweet, All Rights Reserved.
 41 | %copyright 2020 by Jim Jagielski, All Rights Reserved.
 42 | %vendor Michael R Sweet
 43 | %vendor Jim Jagielski
 44 | %license ${srcdir}/LICENSE
 45 | %readme ${srcdir}/README.md
 46 | %description Universal software packaging tool for UNIX.
 47 | %version 4.6 460
 48 | 
49 | 50 |

After the product information, we include all of the non-GUI 51 | files that are part of EPM:

52 | 53 |
 54 | # Executables
 55 | %system all
 56 | f 0555 root sys ${bindir}/epm epm
 57 | f 0555 root sys ${bindir}/epminstall epminstall
 58 | f 0555 root sys ${bindir}/mkepmlist mkepmlist
 59 | 
 60 | # Documentation
 61 | %subpackage documentation
 62 | %description Documentation for EPM
 63 | f 0444 root sys ${docdir}/README $srcdir/README.md
 64 | f 0444 root sys ${docdir}/LICENSE $srcdir/LICENSE
 65 | f 0444 root sys ${docdir}/epm-book.epub $srcdir/doc/epm-book.epub
 66 | f 0444 root sys ${docdir}/epm-book.html $srcdir/doc/epm-book.html
 67 | f 0444 root sys ${docdir}/epm-book.pdf $srcdir/doc/epm-book.pdf
 68 | 
 69 | # Man pages
 70 | %subpackage man
 71 | %description Man pages for EPM
 72 | f 0444 root sys ${mandir}/man1/epm.1 $srcdir/doc/epm.man
 73 | f 0444 root sys ${mandir}/man1/epminstall.1 $srcdir/doc/epminstall.1
 74 | f 0444 root sys ${mandir}/man1/mkepmlist.1 $srcdir/doc/mkepmlist.1
 75 | f 0444 root sys ${mandir}/man5/epm.list.5 $srcdir/doc/epm.list.5
 76 | 
77 | 78 |

Finally, we conditionally include the GUI files depending on 79 | the state of a variable called GUIS:

80 | 81 |
 82 | # GUI files...
 83 | $GUIS=setup uninst
 84 | 
 85 | %if GUIS
 86 | %subpackage
 87 | f 0555 root sys ${libdir}/epm/setup setup
 88 | f 0555 root sys ${libdir}/epm/uninst uninst
 89 | 
 90 | %system macos
 91 | f 0444 root sys ${datadir}/epm/default.icns default.icns
 92 | %system all
 93 | 
 94 | %subpackage man
 95 | f 0444 root sys ${mandir}/man1/setup.1 $srcdir/doc/setup.1
 96 | f 0444 root sys ${mandir}/man5/setup.types.5 $srcdir/doc/setup.types.5
 97 | 
 98 | %endif
 99 | 
100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /doc/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for the ESP Package Manager (EPM) documentation. 3 | # 4 | # Copyright © 2020 by Jim Jagielski 5 | # Copyright © 1999-2020 by Michael R Sweet 6 | # Copyright © 1999-2006 by Easy Software Products, all rights reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License.# 19 | 20 | # Programs... 21 | CC = @CC@ 22 | HTMLDOC = @HTMLDOC@ 23 | RM = @RM@ -f 24 | INSTALL = @INSTALL@ 25 | 26 | # Program options... 27 | ARFLAGS = @ARFLAGS@ 28 | ARCHFLAGS = @ARCHFLAGS@ 29 | CFLAGS = $(ARCHFLAGS) @CFLAGS@ $(OPTIM) 30 | CPPFLAGS = @CPPFLAGS@ 31 | LDFLAGS = $(ARCHFLAGS) @LDFLAGS@ $(OPTIM) 32 | LIBS = @LIBS@ 33 | OPTIM = @OPTIM@ 34 | 35 | 36 | # Directories... 37 | bindir = @bindir@ 38 | datadir = @datadir@ 39 | datarootdir = @datarootdir@ 40 | docdir = @docdir@ 41 | exec_prefix = @exec_prefix@ 42 | includedir = @includedir@ 43 | infodir = @infodir@ 44 | libdir = @libdir@ 45 | libexecdir = @libexecdir@ 46 | localstatedir = @localstatedir@ 47 | mandir = @mandir@ 48 | oldincludedir = @oldincludedir@ 49 | prefix = @prefix@ 50 | privateinclude = @privateinclude@ 51 | sbindir = @sbindir@ 52 | sharedstatedir = @sharedstatedir@ 53 | srcdir = @srcdir@ 54 | sysconfdir = @sysconfdir@ 55 | top_srcdir = @top_srcdir@ 56 | 57 | BUILDROOT = $(DSTROOT)$(RPM_BUILD_ROOT)$(DESTDIR) 58 | VPATH = $(srcdir) 59 | 60 | 61 | # Man page generation rule... 62 | .SUFFIXES: .html .1 .5 63 | .1.html .5.html: 64 | $(RM) $@ 65 | ./mantohtml $< >$@ 66 | 67 | 68 | # Targets... 69 | MANPAGES = epm.html epminstall.html mkepmlist.html setup.html 70 | HTMLFILES = title.html preface.html 1-intro.html 2-building.html \ 71 | 3-packaging.html 4-advanced.html 5-examples.html \ 72 | a-license.html b-manpages.html c-reference.html \ 73 | $(MANPAGES) 74 | BOOKS = epm-book.epub epm-book.html epm-book.pdf 75 | 76 | 77 | # Make everything (requires HTMLDOC) 78 | all: $(MANPAGES) $(BOOKS) 79 | 80 | # Clean generated programs 81 | clean: 82 | $(RM) mantohtml mantohtml.o 83 | 84 | # Install documentation 85 | install: 86 | echo Installing EPM manpages in $(BUILDROOT)$(mandir)/man1 87 | $(INSTALL) -d -m 755 $(BUILDROOT)$(mandir)/man1 88 | for file in epm.1 epminstall.1 mkepmlist.1 setup.1; do \ 89 | $(INSTALL) -c -m 644 $$file $(BUILDROOT)$(mandir)/man1; \ 90 | done 91 | echo Installing EPM manpages in $(BUILDROOT)$(mandir)/man5 92 | $(INSTALL) -d -m 755 $(BUILDROOT)$(mandir)/man5 93 | for file in epm.list.5 setup.types.5; do \ 94 | $(INSTALL) -c -m 644 $$file $(BUILDROOT)$(mandir)/man5; \ 95 | done 96 | echo Installing EPM documentation in $(BUILDROOT)$(docdir) 97 | $(INSTALL) -d -m 755 $(BUILDROOT)$(docdir) 98 | for file in $(top_srcdir)/LICENSE $(top_srcdir)/README.md $(BOOKS); do \ 99 | $(INSTALL) -c -m 644 $$file $(BUILDROOT)$(docdir); \ 100 | done 101 | 102 | 103 | # Uninstall all targets... 104 | uninstall: 105 | echo Uninstalling EPM manpages from $(BUILDROOT)$(mandir)/man1 106 | $(RM) $(BUILDROOT)$(mandir)/man1/epm.1 107 | $(RM) $(BUILDROOT)$(mandir)/man1/epminstall.1 108 | $(RM) $(BUILDROOT)$(mandir)/man1/mkepmlist.1 109 | $(RM) $(BUILDROOT)$(mandir)/man1/setup.1 110 | echo Uninstalling EPM manpages from $(BUILDROOT)$(mandir)/man5 111 | $(RM) $(BUILDROOT)$(mandir)/man5/epm.list.5 112 | $(RM) $(BUILDROOT)$(mandir)/man5/setup.types.5 113 | echo Uninstalling EPM documentation from $(BUILDROOT)$(docdir) 114 | $(RM) -r $(BUILDROOT)$(docdir) 115 | 116 | # EPUB book 117 | epm-book.epub: $(HTMLFILES) epm-256.png setup.png title.png epm-book.book 118 | $(HTMLDOC) --batch epm-book.book --titleimage title.png -f epm-book.epub 119 | 120 | # HTML book 121 | epm-book.html: $(HTMLFILES) epm-256.png setup.png epm-book.book 122 | $(HTMLDOC) --batch epm-book.book -f epm-book.html 123 | 124 | # PDF book 125 | epm-book.pdf: $(HTMLFILES) epm-256.png setup.png epm-book.book 126 | $(HTMLDOC) --batch epm-book.book --size universal -f epm-book.pdf 127 | 128 | # mantohtml 129 | mantohtml: mantohtml.o 130 | $(CC) -o $@ mantohtml.o 131 | 132 | # HTML man pages 133 | $(MANPAGES): mantohtml 134 | -------------------------------------------------------------------------------- /doc/b-manpages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

B - Command Reference

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/epm-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/epm-256.png -------------------------------------------------------------------------------- /doc/epm-book.book: -------------------------------------------------------------------------------- 1 | #HTMLDOC 1.9 2 | -t pdf14 -f "epm-book.pdf" --book --toclevels 2 --no-numbered --toctitle "Table of Contents" --title --titleimage "title.html" --linkstyle plain --size 6x9in --left 1in --right 0.750in --top 0.750in --bottom 0.750in --header .t. --header1 ... --footer h.1 --nup 1 --tocheader .t. --tocfooter ..i --duplex --portrait --color --no-pscommands --no-xrxcomments --compression=9 --jpeg=90 --fontsize 10.0 --fontspacing 1.2 --headingfont Sans --bodyfont Sans --headfootsize 9.0 --headfootfont Sans-Oblique --charset iso-8859-1 --links --embedfonts --pagemode document --pagelayout tworight --firstpage p1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password "" --user-password "" --browserwidth 680 --strict --no-overflow 3 | preface.html 4 | 1-intro.html 5 | 2-building.html 6 | 3-packaging.html 7 | 4-advanced.html 8 | 5-examples.html 9 | a-license.html 10 | b-manpages.html 11 | c-reference.html 12 | -------------------------------------------------------------------------------- /doc/epm-book.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/epm-book.epub -------------------------------------------------------------------------------- /doc/epm-book.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/epm-book.pdf -------------------------------------------------------------------------------- /doc/epm.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM). 3 | .\" 4 | .\" Copyright © 2020 by Jim Jagielski 5 | .\" Copyright © 1999-2020 by Michael R Sweet 6 | .\" Copyright © 1999-2008 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH epm 1 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | epm \- create software packages. 23 | .SH SYNOPSIS 24 | .B epm 25 | [ 26 | .B \-a 27 | .I architecture 28 | ] [ 29 | .B \-f 30 | .I format 31 | ] [ 32 | .B \-g 33 | ] [ 34 | .B \-k 35 | ] [ 36 | .B \-m 37 | .I name 38 | ] [ 39 | \fB\-n\fR[\fBmrs\fR] ] [ 40 | .B \-s 41 | .I setup.ext 42 | ] [ 43 | .B \-\-depend 44 | ] [ 45 | .B \-\-help 46 | ] [ 47 | .B \-\-keep\-files 48 | ] [ 49 | .B \-\-output\-dir 50 | .I directory 51 | ] [ 52 | .B \-\-setup\-image 53 | .I setup.ext 54 | ] [ 55 | .B \-\-setup\-program 56 | .I /foo/bar/setup 57 | ] [ 58 | .B \-\-setup\-types 59 | .I setup.types 60 | ] [ 61 | .B \-\-uninstall\-program 62 | .I /foo/bar/uninst 63 | ] [ 64 | .B \-v 65 | ] [ 66 | .I name=value 67 | \... 68 | .I name=value 69 | ] 70 | .I product 71 | [ 72 | .I listfile 73 | ] 74 | .SH DESCRIPTION 75 | .BR epm (1) 76 | generates software packages complete with installation, removal, and (if necessary) patch scripts. 77 | Unless otherwise specified, the files required for \fIproduct\fR are read from a file named "\fIproduct\fR.list". 78 | .SH OPTIONS 79 | The following options are recognized: 80 | .TP 5 81 | \fB\-a \fIarchitecture\fR 82 | Specifies the actual architecture for the software. 83 | Without this option the generic processor architecture is used ("intel", "sparc", "mips", etc.) 84 | .TP 5 85 | \fB\-f bsd\fR 86 | Generate a BSD distribution suitable for installation on a FreeBSD, NetBSD, or OpenBSD system. 87 | .TP 5 88 | \fB\-f deb\fR 89 | Generate a Debian distribution suitable for installation on a Debian-based Linux system. 90 | .TP 5 91 | \fB\-f native\fR 92 | Generate a native distribution. 93 | This uses \fIdeb\fR or \fIrpm\fR for Linux, \fIbsd\fR for FreeBSD, NetBSD, and OpenBSD, and \fImacos\fR for macOS. 94 | All other operating systems default to the \fIportable\fR format. 95 | .TP 5 96 | \fB\-f macos\fR 97 | .TP 5 98 | \fB\-f macos\-signed\fR 99 | Generate a macOS software package. 100 | The \fImacos\-signed\fR format uses the signing identity in the EPM_SIGNING_IDENTITY environment variable. 101 | .TP 5 102 | \fB\-f portable\fR 103 | Generate a portable distribution based on shell scripts and tar files. 104 | The resulting distribution is installed and removed the same way on all operating systems. [default] 105 | .TP 5 106 | \fB\-f rpm\fR 107 | .TP 5 108 | \fB\-f rpm\-signed\fR 109 | Generate a Red Hat Package Manager ("RPM") distribution suitable for installation on an RPM-based Linux system. 110 | The \fIrpm\-signed\fR format uses the GPG private key you have defined in the ~/.rpmmacros file. 111 | .TP 5 112 | \fB\-g\fR 113 | Disable stripping of executable files in the distribution. 114 | .TP 5 115 | \fB\-k\fR 116 | Keep intermediate (spec, etc.) files used to create the distribution in the distribution directory. 117 | .TP 5 118 | \fB\-m \fIname\fR 119 | Specifies the platform name as a string. 120 | The default is to use the auto-generated name from the \fI\-n\fR option. 121 | .TP 5 122 | \fB\-n\fR[\fImrs\fR] 123 | Specifies the operating system and machine information that is included in the package name. 124 | Distributions normally are named "product-version-system-release-machine.ext" and "product-version-system-release-machine-patch.ext" for patch distributions. 125 | The "system-release-machine" information can be customized or eliminated using the appropriate trailing letters. 126 | Using \fI-n\fR by itself will remove the "system-release-machine" string from the filename entirely. 127 | The letter 'm' includes the architecture (machine). 128 | The letter 'r' includes the operating system version (release). 129 | The letter 's' includes the operating system name. 130 | .TP 5 131 | \fB\-v\fR 132 | Increases the amount of information that is reported. 133 | Use multiple v's for more verbose output. 134 | .TP 5 135 | \fB\-\-depend\fR 136 | Lists the dependent (source) files for all files in the package. 137 | .TP 5 138 | \fB\-\-output\-dir \fIdirectory\fR 139 | Specifies the directory for output files. 140 | The default directory is based on the operating system, version, and architecture. 141 | .TP 5 142 | \fB\-s \fIsetup.ext\fR 143 | .TP 5 144 | \fB\-\-setup\-image \fIsetup.ext\fR 145 | Include the ESP Software Wizard with the specified image file with the distribution. 146 | This option is currently only supported by portable distributions. 147 | .TP 5 148 | \fB\-\-setup\-program \fI/foo/bar/setup\fR 149 | Specifies the setup executable to use with the distribution. 150 | This option is currently only supported by portable distributions. 151 | .TP 5 152 | \fB\-\-setup\-types \fIsetup.types\fR 153 | .LP 154 | Specifies the \fIsetup.types\fR file to include with the distribution. 155 | This option is currently only supported by portable distributions. 156 | .TP 5 157 | \fB\-\-uninstall\-program \fI/foo/bar/uninst\fR 158 | Specifies the uninst executable to use with the distribution. 159 | This option is currently only supported by portable distributions. 160 | .SH ENVIRONMENT 161 | The following environment variables are supported by \fBepm\fR: 162 | .TP 5 163 | .B EPM_SIGNING_IDENTITY 164 | The common name that should be used when signing a package. 165 | .SH LIST FILES 166 | The EPM list file format is now described in the \fIepm.list(5)\fR 167 | man page. 168 | .SH SEE ALSO 169 | .BR epminstall (1), 170 | .BR mkepmlist (1), 171 | .BR epm.list (5), 172 | .BR setup (1). 173 | .SH COPYRIGHT 174 | Copyright \[co] 1999-2020 by Michael R Sweet, All Rights Reserved. 175 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 176 | .LP 177 | Licensed under the Apache License, Version 2.0 (the "License"); 178 | you may not use this file except in compliance with the License. 179 | You may obtain a copy of the License at 180 | .LP 181 | http://www.apache.org/licenses/LICENSE-2.0 182 | .LP 183 | Unless required by applicable law or agreed to in writing, software 184 | distributed under the License is distributed on an "AS IS" BASIS, 185 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 186 | See the License for the specific language governing permissions and 187 | limitations under the License. 188 | -------------------------------------------------------------------------------- /doc/epm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | epm(1) 7 | 8 | 9 |

epm(1)

10 |

Name

11 | epm - create software packages. 12 |

Synopsis

13 | epm 14 | [ 15 | -a 16 | architecture 17 | ] [ 18 | -f 19 | format 20 | ] [ 21 | -g 22 | ] [ 23 | -k 24 | ] [ 25 | -m 26 | name 27 | ] [ 28 | -n[mrs] ] [ 29 | -s 30 | setup.ext 31 | ] [ 32 | --depend 33 | ] [ 34 | --help 35 | ] [ 36 | --keep-files 37 | ] [ 38 | --output-dir 39 | directory 40 | ] [ 41 | --setup-image 42 | setup.ext 43 | ] [ 44 | --setup-program 45 | /foo/bar/setup 46 | ] [ 47 | --setup-types 48 | setup.types 49 | ] [ 50 | --uninstall-program 51 | /foo/bar/uninst 52 | ] [ 53 | -v 54 | ] [ 55 | name=value 56 | ... 57 | name=value 58 | ] 59 | product 60 | [ 61 | listfile 62 | ] 63 |

Description

64 | epm(1) 65 | generates software packages complete with installation, removal, and (if necessary) patch scripts. 66 | Unless otherwise specified, the files required for product are read from a file named "product.list". 67 |

Options

68 | The following options are recognized: 69 |
70 |
-a architecture 71 |
Specifies the actual architecture for the software. 72 | Without this option the generic processor architecture is used ("intel", "sparc", "mips", etc.) 73 |
-f bsd 74 |
Generate a BSD distribution suitable for installation on a FreeBSD, NetBSD, or OpenBSD system. 75 |
-f deb 76 |
Generate a Debian distribution suitable for installation on a Debian-based Linux system. 77 |
-f native 78 |
Generate a native distribution. 79 | This uses deb or rpm for Linux, bsd for FreeBSD, NetBSD, and OpenBSD, and macos for macOS. 80 | All other operating systems default to the portable format. 81 |
-f macos 82 |
-f macos-signed 83 |
Generate a macOS software package. 84 | The macos-signed format uses the signing identity in the EPM_SIGNING_IDENTITY environment variable. 85 |
-f portable 86 |
Generate a portable distribution based on shell scripts and tar files. 87 | The resulting distribution is installed and removed the same way on all operating systems. [default] 88 |
-f rpm 89 |
-f rpm-signed 90 |
Generate a Red Hat Package Manager ("RPM") distribution suitable for installation on an RPM-based Linux system. 91 | The rpm-signed format uses the GPG private key you have defined in the ~/.rpmmacros file. 92 |
-g 93 |
Disable stripping of executable files in the distribution. 94 |
-k 95 |
Keep intermediate (spec, etc.) files used to create the distribution in the distribution directory. 96 |
-m name 97 |
Specifies the platform name as a string. 98 | The default is to use the auto-generated name from the -n option. 99 |
-n[mrs] 100 |
Specifies the operating system and machine information that is included in the package name. 101 | Distributions normally are named "product-version-system-release-machine.ext" and "product-version-system-release-machine-patch.ext" for patch distributions. 102 | The "system-release-machine" information can be customized or eliminated using the appropriate trailing letters. 103 | Using -n by itself will remove the "system-release-machine" string from the filename entirely. 104 | The letter 'm' includes the architecture (machine). 105 | The letter 'r' includes the operating system version (release). 106 | The letter 's' includes the operating system name. 107 |
-v 108 |
Increases the amount of information that is reported. 109 | Use multiple v's for more verbose output. 110 |
--depend 111 |
Lists the dependent (source) files for all files in the package. 112 |
--output-dir directory 113 |
Specifies the directory for output files. 114 | The default directory is based on the operating system, version, and architecture. 115 |
-s setup.ext 116 |
--setup-image setup.ext 117 |
Include the ESP Software Wizard with the specified image file with the distribution. 118 | This option is currently only supported by portable distributions. 119 |
--setup-program /foo/bar/setup 120 |
Specifies the setup executable to use with the distribution. 121 | This option is currently only supported by portable distributions. 122 |
--setup-types setup.types 123 |
124 |

Specifies the setup.types file to include with the distribution. 125 | This option is currently only supported by portable distributions. 126 |

127 |
--uninstall-program /foo/bar/uninst 128 |
Specifies the uninst executable to use with the distribution. 129 | This option is currently only supported by portable distributions. 130 |
131 |

Environment

132 | The following environment variables are supported by epm: 133 |
134 |
EPM_SIGNING_IDENTITY 135 |
The common name that should be used when signing a package. 136 |
137 |

List Files

138 | The EPM list file format is now described in the epm.list(5) 139 | man page. 140 |

See Also

141 | epminstall(1), 142 | mkepmlist(1), 143 | epm.list(5), 144 | setup(1). 145 |

Copyright

146 | Copyright © 1999-2020 by Michael R Sweet, All Rights Reserved. 147 | Copyright © 2020 by Jim Jagielski, All Rights Reserved. 148 |

Licensed under the Apache License, Version 2.0 (the "License"); 149 | you may not use this file except in compliance with the License. 150 | You may obtain a copy of the License at 151 |

http://www.apache.org/licenses/LICENSE-2.0 152 |

Unless required by applicable law or agreed to in writing, software 153 | distributed under the License is distributed on an "AS IS" BASIS, 154 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 155 | See the License for the specific language governing permissions and 156 | limitations under the License. 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /doc/epm.list.5: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM) list file format. 3 | .\" 4 | .\" Copyright 20202 by Jim Jagielski 5 | .\" Copyright 1999-2017 by Michael R Sweet 6 | .\" Copyright 1999-2010 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH epm.list 5 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | epm.list \- epm list file format. 23 | .SH DESCRIPTION 24 | Each 25 | .BR epm (1) 26 | product has an associated list file that describes the files to include with the product. 27 | Comment lines begin with the "#" character and are ignored. 28 | All other non-blank lines must begin with a letter, dollar sign ("$"), or the percent sign ("%") as follows: 29 | .TP 5 30 | $name=value 31 | Sets the named variable to \fIvalue\fR. 32 | \fBNote:\fR Variables set in the list file are overridden by variables specified on the command-line or in the current environment. 33 | .TP 5 34 | %arch all 35 | Uses following files and directives on all processor architectures. 36 | .TP 5 37 | %arch \fIarchitecture [... architecture]\fR 38 | Uses following files and directives on the named processor architectures. 39 | .TP 5 40 | %arch !\fIarchitecture [... architecture]\fR 41 | Uses following files and directives on all but the named processor 42 | architectures. 43 | .TP 5 44 | %copyright \fIcopyright notice\fR 45 | Sets the copyright notice for the file. 46 | .TP 5 47 | %description \fIdescription text\fR 48 | Adds a line of descriptive text to the distribution. Multiple lines are 49 | supported. 50 | .TP 5 51 | %format \fIformat [... format]\fR 52 | Uses following files and directives only if the distribution format is the same as \fIformat\fR. 53 | .TP 5 54 | %format !\fIformat [... format]\fR 55 | Uses following files and directives only if the distribution format is not the same as \fIformat\fR. 56 | .TP 5 57 | %if \fIvariable\fR [... variable]\fR 58 | .TP 5 59 | %if !\fIvariable\fR [... variable]\fR 60 | .TP 5 61 | %ifdef \fIvariable\fR [... variable]\fR 62 | .TP 5 63 | %ifdef !\fIvariable\fR [... variable]\fR 64 | .TP 5 65 | %elseif \fIvariable\fR [... variable]\fR 66 | .TP 5 67 | %elseif !\fIvariable\fR [... variable]\fR 68 | .TP 5 69 | %elseifdef \fIvariable\fR [... variable]\fR 70 | .TP 5 71 | %elseifdef !\fIvariable\fR [... variable]\fR 72 | .TP 5 73 | %else 74 | .TP 5 75 | %endif 76 | Conditionally includes lines in the list file. 77 | The \fI%if\fR lines include the lines that follow if the named variables are (not) defined with a value. 78 | The \fI%ifdef\fR lines include the lines that follow if the named variables are (not) defined with any value. 79 | These conditional lines cannot be nested. 80 | .TP 5 81 | %include \fIfilename\fR 82 | Includes files listed in \fIfilename\fR. 83 | .TP 5 84 | %incompat \fIproduct\fR 85 | .TP 5 86 | %incompat \fIfilename\fR 87 | Indicates that this product is incompatible with the named product or file. 88 | .TP 5 89 | %install \fIscript or program\fR 90 | Specifies a script or program to be run after all files are installed. 91 | (This has been obsoleted by the %postinstall directive) 92 | .TP 5 93 | %license \fIlicense file\fR 94 | Specifies the file to display as the software license. 95 | .TP 5 96 | %literal(section) \fIline\fR 97 | .TP 5 98 | %literal(section) <\fIfile\fR 99 | .TP 5 100 | %literal(section) <<\fIstring\fR 101 | Specifies format-specific literal data for packaging. 102 | Currently only supported for RPM and PKG packages. 103 | .TP 5 104 | %packager \fIname of packager\fR 105 | Specifies the name of the packager. 106 | .TP 5 107 | %patch \fIscript or program\fR 108 | Specifies a script or program to be run after all files are patched. 109 | (This has been obsoleted by the %postpatch directive) 110 | .TP 5 111 | %postinstall \fIscript or program\fR 112 | .TP 5 113 | %postinstall <\fIscriptfile\fR 114 | .TP 5 115 | %postinstall <<\fIstring\fR 116 | Specifies a script or program to be run after all files are installed. 117 | .TP 5 118 | %postpatch \fIscript or program\fR 119 | .TP 5 120 | %postpatch <\fIscriptfile\fR 121 | .TP 5 122 | %postpatch <<\fIstring\fR 123 | Specifies a script or program to be run after all files are patched. 124 | .TP 5 125 | %postremove \fIscript or program\fR 126 | .TP 5 127 | %postremove <\fIscriptfile\fR 128 | .TP 5 129 | %postremove <<\fIstring\fR 130 | Specifies a script or program to be run after removing files. 131 | .TP 5 132 | %preinstall \fIscript or program\fR 133 | .TP 5 134 | %preinstall <\fIscriptfile\fR 135 | .TP 5 136 | %preinstall <<\fIstring\fR 137 | Specifies a script or program to be run before all files are installed. 138 | .TP 5 139 | %prepatch \fIscript or program\fR 140 | .TP 5 141 | %prepatch <\fIscriptfile\fR 142 | .TP 5 143 | %prepatch <<\fIstring\fR 144 | Specifies a script or program to be run before all files are patched. 145 | .TP 5 146 | %preremove \fIscript or program\fR 147 | .TP 5 148 | %preremove <\fIscriptfile\fR 149 | .TP 5 150 | %preremove <<\fIstring\fR 151 | Specifies a script or program to be run before removing files. 152 | .TP 5 153 | %product \fIproduct name\fR 154 | Specifies the product name. 155 | .TP 5 156 | %readme \fIreadme file\fR 157 | Specifies a README file to be included in the distribution. 158 | .TP 5 159 | %remove \fIscript or program\fR 160 | Specifies a script or program to be run before removing files. 161 | (This has been obsoleted by the %preremove directive) 162 | .TP 5 163 | %release \fInumber\fR 164 | Specifies the release or build number of a product (defaults to 0). 165 | .TP 5 166 | %replaces \fIproduct\fR 167 | Indicates that this product replaces the named product. 168 | .TP 5 169 | %requires \fIproduct\fR 170 | .TP 5 171 | %requires \fIfilename\fR 172 | Indicates that this product requires the named product or file. 173 | .TP 5 174 | %subpackage 175 | .TP 5 176 | %subpackage \fIname\fR 177 | Selects the named subpackage; if no name is given, selects the main (parent) package. 178 | .TP 5 179 | %vendor \fIvendor or author name\fR 180 | Specifies the vendor or author of the product. 181 | .TP 5 182 | %version \fIversion number\fR 183 | Specifies the version number of the product. 184 | .TP 5 185 | %system \fIsystem[-release] [... system[-release]]\fR 186 | Specifies that the following files should only be used for the specified operating systems and releases. 187 | .TP 5 188 | %system !\fIsystem[-release] [... system[-release]]\fR 189 | Specifies that the following files should not be used for the specified operating systems and releases. 190 | .TP 5 191 | %system all 192 | Specifies that the following files are applicable to all operating systems. 193 | .TP 5 194 | c \fImode user group destination source\fR 195 | .TP 5 196 | C \fImode user group destination source\fR 197 | Specifies a configuration file for installation. 198 | The second form specifies that the file has changed or is new and should be included as part of a patch. 199 | Configuration files are installed as "destination.N" if the destination already exists. 200 | .TP 5 201 | d \fImode user group destination -\fR 202 | .TP 5 203 | D \fImode user group destination -\fR 204 | Specifies a directory should be created when installing the software. 205 | The second form specifies that the directory is new and should be included as part of a patch. 206 | .TP 5 207 | f \fImode user group destination source [nostrip()]\fR 208 | .TP 5 209 | F \fImode user group destination source [nostrip()]\fR 210 | Specifies a file for installation. 211 | The second form specifies that the file has changed or is new and should be included as part of a patch. 212 | If the "nostrip()" option is included, the file will not be stripped before the installation is created. 213 | .TP 5 214 | f \fImode user group destination source/pattern [nostrip()]\fR 215 | .TP 5 216 | F \fImode user group destination source/pattern [nostrip()]\fR 217 | Specifies one or more files for installation using shell wildcard patterns. 218 | The second form specifies that the files have changed or are new and should be included as part of a patch. 219 | If the "nostrip()" option is included, the file will not be stripped before the installation is created. 220 | .TP 5 221 | i \fImode user group service-name source ["options"]\fR 222 | .TP 5 223 | I \fImode user group service-name source ["options"]\fR 224 | Specifies an initialization script for installation. 225 | The second form specifies that the file has changed or is new and should be included as part of a patch. 226 | Initialization scripts are stored in /etc/software/init.d and are linked to the appropriate system-specific directories for run levels 0, 2, 3, and 5. 227 | Initialization scripts \fBmust\fR accept at least the \fIstart\fR and \fIstop\fR commands. 228 | The optional \fIoptions\fR following the source filename can be any of the following: 229 | .TP 10 230 | order(\fIstring\fR) 231 | Specifies the relative startup order compared to the required and used system functions. 232 | Supported values include First, Early, None, Late, and Last (macOS only). 233 | .TP 10 234 | provides(\fIname(s)\fR) 235 | Specifies names of system functions that are provided by this startup item (macOS only). 236 | .TP 10 237 | requires(\fIname(s)\fR) 238 | Specifies names of system functions that are required by this startup item (macOS only). 239 | .TP 10 240 | runlevel(\fIlevels\fR) 241 | Specifies the run levels to use. 242 | .TP 10 243 | start(\fInumber\fR) 244 | Specifies the starting sequence number from 00 to 99. 245 | .TP 10 246 | stop(\fInumber\fR) 247 | Specifies the ending sequence number from 00 to 99. 248 | .TP 10 249 | uses(\fIname(s)\fR) 250 | Specifies names of system functions that are used by this startup 251 | item (macOS only). 252 | 253 | .TP 5 254 | l \fImode user group destination source\fR 255 | .TP 5 256 | L \fImode user group destination source\fR 257 | Specifies a symbolic link in the installation. 258 | The second form specifies that the link has changed or is new and should be included as part of a patch. 259 | .TP 5 260 | R \fImode user group destination\fR 261 | Specifies that the file is to be removed upon patching. 262 | The \fIuser\fR and \fIgroup\fR fields are ignored. 263 | The \fImode\fR field is only used to determine if a check should be made for a previous version of the file. 264 | .SH LIST VARIABLES 265 | \fIEPM\fR maintains a list of variables and their values which can be used to substitute values in the list file. 266 | These variables are imported from the current environment and taken from the command-line and list file as provided. 267 | Substitutions occur when the variable name is referenced with the dollar sign ($): 268 | .nf 269 | .br 270 | 271 | %postinstall < 2 | 3 | 4 | 5 | 6 | epminstall(1) 7 | 8 | 9 |

epminstall(1)

10 |

Name

11 | epminstall - add a directory, file, or symlink to a list file. 12 |

Synopsis

13 | epminstall 14 | [ 15 | options 16 | ] 17 | file1file2...fileNdirectory 18 |
19 | epminstall 20 | [ 21 | options 22 | ] 23 | file1file2 24 |
25 | epminstall 26 | [ 27 | options 28 | ] 29 | -d 30 | directory1directory2...directoryN 31 |

Description

32 | epminstall 33 | adds or replaces a directory, file, or symlink 34 | in a list file. The default list file is "epm.list" and can be 35 | overridden using the EPMLIST environment variable or the 36 | --list-file option. 37 |

Entries are either added to the end of the list file or replaced 38 | in-line. Comments, directives, and variable declarations in the 39 | list file are preserved. 40 |

Options

41 | epminstall 42 | recognizes the standard Berkeley 43 | install(8) 44 | command options: 45 |
46 |
-b 47 |
Make a backup of existing files (ignored, default for epm.) 48 |
-c 49 |
BSD old compatibility mode (ignored.) 50 |
-g group 51 |
Set the group owner of the file or directory to group. 52 | The default group is "sys". 53 |
-m mode 54 |
Set the permissions of the file or directory to mode. 55 | The default permissions are 0755 for directories and executable files and 0644 for non-executable files. 56 |
-o owner 57 |
Set the owner of the file or directory to owner. 58 | The default owner is "root". 59 |
-s 60 |
Strip the files (ignored, default for epm.) 61 |
--list-file filename.list 62 |
Specify the list file to update. 63 |
64 |

See Also

65 | epm(1), 66 | mkepmlist(1), 67 | epm.list(5). 68 |

Copyright

69 | Copyright © 1999-2020 by Michael R Sweet, All Rights Reserved. 70 | Copyright © 2020 by Jim Jagielski, All Rights Reserved. 71 |

Licensed under the Apache License, Version 2.0 (the "License"); 72 | you may not use this file except in compliance with the License. 73 | You may obtain a copy of the License at 74 |

http://www.apache.org/licenses/LICENSE-2.0 75 |

Unless required by applicable law or agreed to in writing, software 76 | distributed under the License is distributed on an "AS IS" BASIS, 77 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78 | See the License for the specific language governing permissions and 79 | limitations under the License. 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /doc/epminstall.man: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM) install program. 3 | .\" 4 | .\" Copyright 2020 by Jim Jagielski 5 | .\" Copyright 1999-2017 by Michael R Sweet 6 | .\" Copyright 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH epminstall 1 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | epminstall \- add a directory, file, or symlink to a list file. 23 | .SH SYNOPSIS 24 | .B epminstall 25 | [ 26 | .I options 27 | ] 28 | .I file1 file2 ... fileN directory 29 | .br 30 | .B epminstall 31 | [ 32 | .I options 33 | ] 34 | .I file1 file2 35 | .br 36 | .B epminstall 37 | [ 38 | .I options 39 | ] 40 | .B \-d 41 | .I directory1 directory2 ... directoryN 42 | .SH DESCRIPTION 43 | .B epminstall 44 | adds or replaces a directory, file, or symlink 45 | in a list file. The default list file is "epm.list" and can be 46 | overridden using the \fIEPMLIST\fR environment variable or the 47 | \fI--list-file\fR option. 48 | .LP 49 | Entries are either added to the end of the list file or replaced 50 | in-line. Comments, directives, and variable declarations in the 51 | list file are preserved. 52 | .SH OPTIONS 53 | .B epminstall 54 | recognizes the standard Berkeley 55 | .BR install (8) 56 | command options: 57 | .TP 5 58 | .B \-b 59 | Make a backup of existing files (ignored, default for \fBepm\fR.) 60 | .TP 5 61 | .B \-c 62 | BSD old compatibility mode (ignored.) 63 | .TP 5 64 | \fB\-g \fIgroup\fR 65 | Set the group owner of the file or directory to \fIgroup\fR. 66 | The default group is "sys". 67 | .TP 5 68 | \fB\-m \fImode\fR 69 | Set the permissions of the file or directory to \fImode\fR. 70 | The default permissions are 0755 for directories and executable files and 0644 for non-executable files. 71 | .TP 5 72 | \fB\-o \fIowner\fR 73 | Set the owner of the file or directory to \fIowner\fR. 74 | The default owner is "root". 75 | .TP 5 76 | .B \-s 77 | Strip the files (ignored, default for \fBepm\fR.) 78 | .TP 5 79 | \fB\-\-list\-file \fIfilename.list\fR 80 | Specify the list file to update. 81 | .SH SEE ALSO 82 | .BR epm(1), 83 | .BR mkepmlist(1), 84 | .BR epm.list (5). 85 | .SH COPYRIGHT 86 | Copyright \[co] 1999-2017 by Michael R Sweet, All Rights Reserved. 87 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 88 | .LP 89 | Licensed under the Apache License, Version 2.0 (the "License"); 90 | you may not use this file except in compliance with the License. 91 | You may obtain a copy of the License at 92 | .LP 93 | http://www.apache.org/licenses/LICENSE-2.0 94 | .LP 95 | Unless required by applicable law or agreed to in writing, software 96 | distributed under the License is distributed on an "AS IS" BASIS, 97 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 98 | See the License for the specific language governing permissions and 99 | limitations under the License. 100 | -------------------------------------------------------------------------------- /doc/gradient.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/gradient.gif -------------------------------------------------------------------------------- /doc/mkepmlist.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM). 3 | .\" 4 | .\" Copyright 2020 by Jim Jagielski 5 | .\" Copyright 1999-2020 by Michael R Sweet 6 | .\" Copyright 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH mkepmlist 1 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | mkepmlist \- make an epm list file from a directory. 23 | .SH SYNOPSIS 24 | .B mkepmlist 25 | [ 26 | .B \-g 27 | .I group 28 | ] [ 29 | .B \-u 30 | .I user 31 | ] [ 32 | .B \-\-prefix 33 | .I directory 34 | ] 35 | .I directory 36 | [ ... 37 | .I directory 38 | ] 39 | .SH DESCRIPTION 40 | .B mkepmlist (1) 41 | recursively generates file list entries for files, links, and directories. 42 | The file list is send to the standard output. 43 | .SH OPTIONS 44 | .B mkepmlist 45 | supports the following options: 46 | .TP 5 47 | \fB\-g \fIgroup\fR 48 | Overrides the group ownership of the files in the specified directories with the specified group name. 49 | .TP 5 50 | \fB\-u \fIuser\fR 51 | Overrides the user ownership of the files in the specified directories with the specified user name. 52 | .TP 5 53 | \fB\-\-prefix \fIdirectory\fR 54 | Adds the specified directory to the destination path. 55 | For example, if you installed files to "/opt/foo" and wanted to build a distribution that installed the files in "/usr/local", the following command would generate a file 56 | list that is installed in "/usr/local": 57 | .nf 58 | .br 59 | mkepmlist \-\-prefix=/usr/local /opt/foo >foo.list 60 | .fi 61 | .SH SEE ALSO 62 | .BR epm (1), 63 | .BR epminstall (1), 64 | .BR epm.list (5). 65 | .SH COPYRIGHT 66 | Copyright \[co] 1999-2020 by Michael R Sweet, All Rights Reserved. 67 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 68 | .LP 69 | Licensed under the Apache License, Version 2.0 (the "License"); 70 | you may not use this file except in compliance with the License. 71 | You may obtain a copy of the License at 72 | .LP 73 | http://www.apache.org/licenses/LICENSE-2.0 74 | .LP 75 | Unless required by applicable law or agreed to in writing, software 76 | distributed under the License is distributed on an "AS IS" BASIS, 77 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78 | See the License for the specific language governing permissions and 79 | limitations under the License. 80 | -------------------------------------------------------------------------------- /doc/mkepmlist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | mkepmlist(1) 7 | 8 | 9 |

mkepmlist(1)

10 |

Name

11 | mkepmlist - make an epm list file from a directory. 12 |

Synopsis

13 | mkepmlist 14 | [ 15 | -g 16 | group 17 | ] [ 18 | -u 19 | user 20 | ] [ 21 | --prefix 22 | directory 23 | ] 24 | directory 25 | [ ... 26 | directory 27 | ] 28 |

Description

29 | mkepmlist(1) 30 | recursively generates file list entries for files, links, and directories. 31 | The file list is send to the standard output. 32 |

Options

33 | mkepmlist 34 | supports the following options: 35 |
36 |
-g group 37 |
Overrides the group ownership of the files in the specified directories with the specified group name. 38 |
-u user 39 |
Overrides the user ownership of the files in the specified directories with the specified user name. 40 |
--prefix directory 41 |
Adds the specified directory to the destination path. 42 | For example, if you installed files to "/opt/foo" and wanted to build a distribution that installed the files in "/usr/local", the following command would generate a file 43 | list that is installed in "/usr/local": 44 |
45 | 
46 | mkepmlist --prefix=/usr/local /opt/foo >foo.list 47 |
48 |
49 |

See Also

50 | epm(1), 51 | epminstall(1), 52 | epm.list(5). 53 |

Copyright

54 | Copyright © 1999-2020 by Michael R Sweet, All Rights Reserved. 55 | Copyright © 2020 by Jim Jagielski, All Rights Reserved. 56 |

Licensed under the Apache License, Version 2.0 (the "License"); 57 | you may not use this file except in compliance with the License. 58 | You may obtain a copy of the License at 59 |

http://www.apache.org/licenses/LICENSE-2.0 60 |

Unless required by applicable law or agreed to in writing, software 61 | distributed under the License is distributed on an "AS IS" BASIS, 62 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 63 | See the License for the specific language governing permissions and 64 | limitations under the License. 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /doc/mkepmlist.man: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM). 3 | .\" 4 | .\" Copyright 2020 by Jim Jagielski 5 | .\" Copyright 1999-2017 by Michael R Sweet 6 | .\" Copyright 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH mkepmlist 1 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | mkepmlist \- make an epm list file from a directory. 23 | .SH SYNOPSIS 24 | .B mkepmlist 25 | [ 26 | .B \-g 27 | .I group 28 | ] [ 29 | .B \-u 30 | .I user 31 | ] [ 32 | .B \-\-prefix 33 | .I directory 34 | ] 35 | .I directory 36 | [ ... 37 | .I directory 38 | ] 39 | .SH DESCRIPTION 40 | .B mkepmlist (1) 41 | recursively generates file list entries for files, links, and directories. 42 | The file list is send to the standard output. 43 | .SH OPTIONS 44 | .B mkepmlist 45 | supports the following options: 46 | .TP 5 47 | \fB\-g \fIgroup\fR 48 | Overrides the group ownership of the files in the specified directories with the specified group name. 49 | .TP 5 50 | \fB\-u \fIuser\fR 51 | Overrides the user ownership of the files in the specified directories with the specified user name. 52 | .TP 5 53 | \fB\-\-prefix \fIdirectory\fR 54 | Adds the specified directory to the destination path. 55 | For example, if you installed files to "/opt/foo" and wanted to build a distribution that installed the files in "/usr/local", the following command would generate a file 56 | list that is installed in "/usr/local": 57 | .nf 58 | .br 59 | mkepmlist \-\-prefix=/usr/local /opt/foo >foo.list 60 | .fi 61 | .SH SEE ALSO 62 | .BR epm (1), 63 | .BR epminstall (1), 64 | .BR epm.list (5). 65 | .SH COPYRIGHT 66 | Copyright \[co] 1999-2017 by Michael R Sweet, All Rights Reserved. 67 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 68 | .LP 69 | Licensed under the Apache License, Version 2.0 (the "License"); 70 | you may not use this file except in compliance with the License. 71 | You may obtain a copy of the License at 72 | .LP 73 | http://www.apache.org/licenses/LICENSE-2.0 74 | .LP 75 | Unless required by applicable law or agreed to in writing, software 76 | distributed under the License is distributed on an "AS IS" BASIS, 77 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78 | See the License for the specific language governing permissions and 79 | limitations under the License. 80 | -------------------------------------------------------------------------------- /doc/preface.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/preface.html -------------------------------------------------------------------------------- /doc/setup.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM) setup GUI. 3 | .\" 4 | .\" Copyright © 2020 by Jim Jagielski 5 | .\" Copyright © 1999-2020 by Michael R Sweet 6 | .\" Copyright © 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH setup 1 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | setup \- graphical setup program for the esp package manager 23 | .SH SYNOPSIS 24 | .B setup 25 | [ 26 | .I directory 27 | ] 28 | .SH DESCRIPTION 29 | .BR setup (1) 30 | provides a graphical installation interface for EPM-generated portable installation packages. 31 | It presents a step-by-step dialog for collecting a list of packages to install and accepting any license agreements for those packages. 32 | .LP 33 | .B setup 34 | searches for products in the current directory or the directory specified on the command-line. 35 | .SH INSTALLATION TYPES 36 | The default type of installation is "custom". 37 | That is, users will be able to select from the list of products and install them. 38 | .LP 39 | .B setup 40 | also supports other types of installations. 41 | The \fIsetup.types\fR file, if present, defines the other installation types. 42 | .SH SEE ALSO 43 | .BR epm (1), 44 | .BR setup.types (5). 45 | .SH COPYRIGHT 46 | Copyright \[co] 1999-2020 by Michael R Sweet, All Rights Reserved. 47 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 48 | .LP 49 | Licensed under the Apache License, Version 2.0 (the "License"); 50 | you may not use this file except in compliance with the License. 51 | You may obtain a copy of the License at 52 | .LP 53 | http://www.apache.org/licenses/LICENSE-2.0 54 | .LP 55 | Unless required by applicable law or agreed to in writing, software 56 | distributed under the License is distributed on an "AS IS" BASIS, 57 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 58 | See the License for the specific language governing permissions and 59 | limitations under the License. 60 | -------------------------------------------------------------------------------- /doc/setup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | setup(1) 7 | 8 | 9 |

setup(1)

10 |

Name

11 | setup - graphical setup program for the esp package manager 12 |

Synopsis

13 | setup 14 | [ 15 | directory 16 | ] 17 |

Description

18 | setup(1) 19 | provides a graphical installation interface for EPM-generated portable installation packages. 20 | It presents a step-by-step dialog for collecting a list of packages to install and accepting any license agreements for those packages. 21 |

setup 22 | searches for products in the current directory or the directory specified on the command-line. 23 |

Installation Types

24 | The default type of installation is "custom". 25 | That is, users will be able to select from the list of products and install them. 26 |

setup 27 | also supports other types of installations. 28 | The setup.types file, if present, defines the other installation types. 29 |

See Also

30 | epm(1), 31 | setup.types(5). 32 |

Copyright

33 | Copyright © 1999-2020 by Michael R Sweet, All Rights Reserved. 34 | Copyright © 2020 by Jim Jagielski, All Rights Reserved. 35 |

Licensed under the Apache License, Version 2.0 (the "License"); 36 | you may not use this file except in compliance with the License. 37 | You may obtain a copy of the License at 38 |

http://www.apache.org/licenses/LICENSE-2.0 39 |

Unless required by applicable law or agreed to in writing, software 40 | distributed under the License is distributed on an "AS IS" BASIS, 41 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42 | See the License for the specific language governing permissions and 43 | limitations under the License. 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/setup.man: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM) setup GUI. 3 | .\" 4 | .\" Copyright 2020 by Jim Jagielski 5 | .\" Copyright 1999-2017 by Michael R Sweet 6 | .\" Copyright 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH setup 1 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | setup \- graphical setup program for the esp package manager 23 | .SH SYNOPSIS 24 | .B setup 25 | [ 26 | .I directory 27 | ] 28 | .SH DESCRIPTION 29 | .BR setup (1) 30 | provides a graphical installation interface for EPM-generated portable installation packages. 31 | It presents a step-by-step dialog for collecting a list of packages to install and accepting any license agreements for those packages. 32 | .LP 33 | .B setup 34 | searches for products in the current directory or the directory specified on the command-line. 35 | .SH INSTALLATION TYPES 36 | The default type of installation is "custom". 37 | That is, users will be able to select from the list of products and install them. 38 | .LP 39 | .B setup 40 | also supports other types of installations. 41 | The \fIsetup.types\fR file, if present, defines the other installation types. 42 | .SH SEE ALSO 43 | .BR epm (1), 44 | .BR setup.types (5). 45 | .SH COPYRIGHT 46 | Copyright \[co] 1999-2017 by Michael R Sweet, All Rights Reserved. 47 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 48 | .LP 49 | Licensed under the Apache License, Version 2.0 (the "License"); 50 | you may not use this file except in compliance with the License. 51 | You may obtain a copy of the License at 52 | .LP 53 | http://www.apache.org/licenses/LICENSE-2.0 54 | .LP 55 | Unless required by applicable law or agreed to in writing, software 56 | distributed under the License is distributed on an "AS IS" BASIS, 57 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 58 | See the License for the specific language governing permissions and 59 | limitations under the License. 60 | -------------------------------------------------------------------------------- /doc/setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/setup.png -------------------------------------------------------------------------------- /doc/setup.types.5: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM) setup types file format. 3 | .\" 4 | .\" Copyright © 2020 by Jim Jagielski 5 | .\" Copyright © 1999-2020 by Michael R Sweet 6 | .\" Copyright © 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH setup.types 5 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | setup.types \- epm gui setup types file format. 23 | .SH DESCRIPTION 24 | The EPM 25 | .BR setup (1) 26 | program normally presents the user with a list of software products to install, which is called a "custom" software installation. 27 | .LP 28 | If a file called \fIsetup.types\fR is present in the package directory, the user will instead be presented with a list of installation types. 29 | Each type has an associated product list which determines the products that are installed by default. 30 | If a type has no products associated with it, then it is treated as a custom installation and the user is presented with a list of packages to choose from. 31 | .SH FILE FORMAT 32 | The \fIsetup.types\fR file is an ASCII text file consisting of type and product lines. 33 | Comments can be inserted by starting a line with the pound sign (#). 34 | Each installation type is defined by a line starting with the word TYPE. 35 | Products are defined by a line starting with the word INSTALL: 36 | .nf 37 | 38 | TYPE Typical End-User Configuration 39 | INSTALL foo 40 | INSTALL foo-help 41 | TYPE Typical Developer Configuration 42 | INSTALL foo 43 | INSTALL foo-help 44 | INSTALL foo-devel 45 | INSTALL foo-examples 46 | TYPE Custom Configuration 47 | .fi 48 | .LP 49 | In the example above, three installation types are defined. 50 | Since the last type includes no products, the user will be presented with the full list of products to choose from. 51 | .SH SEE ALSO 52 | .BR epm (1), 53 | .BR setup (1). 54 | .SH COPYRIGHT 55 | Copyright \[co] 1999-2020 by Michael R Sweet, All Rights Reserved. 56 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 57 | .LP 58 | Licensed under the Apache License, Version 2.0 (the "License"); 59 | you may not use this file except in compliance with the License. 60 | You may obtain a copy of the License at 61 | .LP 62 | http://www.apache.org/licenses/LICENSE-2.0 63 | .LP 64 | Unless required by applicable law or agreed to in writing, software 65 | distributed under the License is distributed on an "AS IS" BASIS, 66 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 67 | See the License for the specific language governing permissions and 68 | limitations under the License. 69 | -------------------------------------------------------------------------------- /doc/setup.types.man: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Manual page for the ESP Package Manager (EPM) setup types file format. 3 | .\" 4 | .\" Copyright 2020 by Jim Jagielski 5 | .\" Copyright 1999-2017 by Michael R Sweet 6 | .\" Copyright 1999-2007 by Easy Software Products, all rights reserved. 7 | .\" 8 | .\" Licensed under the Apache License, Version 2.0 (the "License"); 9 | .\" you may not use this file except in compliance with the License. 10 | .\" You may obtain a copy of the License at 11 | .\" 12 | .\" http://www.apache.org/licenses/LICENSE-2.0 13 | .\" 14 | .\" Unless required by applicable law or agreed to in writing, software 15 | .\" distributed under the License is distributed on an "AS IS" BASIS, 16 | .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | .\" See the License for the specific language governing permissions and 18 | .\" limitations under the License. 19 | .\" 20 | .TH setup.types 5 "ESP Package Manager" "20 November 2020" "Jim Jagielski" 21 | .SH NAME 22 | setup.types \- epm gui setup types file format. 23 | .SH DESCRIPTION 24 | The EPM 25 | .BR setup (1) 26 | program normally presents the user with a list of software products to install, which is called a "custom" software installation. 27 | .LP 28 | If a file called \fIsetup.types\fR is present in the package directory, the user will instead be presented with a list of installation types. 29 | Each type has an associated product list which determines the products that are installed by default. 30 | If a type has no products associated with it, then it is treated as a custom installation and the user is presented with a list of packages to choose from. 31 | .SH FILE FORMAT 32 | The \fIsetup.types\fR file is an ASCII text file consisting of type and product lines. 33 | Comments can be inserted by starting a line with the pound sign (#). 34 | Each installation type is defined by a line starting with the word TYPE. 35 | Products are defined by a line starting with the word INSTALL: 36 | .in 5 37 | .nf 38 | 39 | TYPE Typical End-User Configuration 40 | INSTALL foo 41 | INSTALL foo-help 42 | TYPE Typical Developer Configuration 43 | INSTALL foo 44 | INSTALL foo-help 45 | INSTALL foo-devel 46 | INSTALL foo-examples 47 | TYPE Custom Configuration 48 | .fi 49 | .in 50 | .LP 51 | In the example above, three installation types are defined. 52 | Since the last type includes no products, the user will be presented with the full list of products to choose from. 53 | .SH SEE ALSO 54 | .BR epm (1), 55 | .BR setup (1). 56 | .SH COPYRIGHT 57 | Copyright \[co] 1999-2017 by Michael R Sweet, All Rights Reserved. 58 | Copyright \[co] 2020 by Jim Jagielski, All Rights Reserved. 59 | .LP 60 | Licensed under the Apache License, Version 2.0 (the "License"); 61 | you may not use this file except in compliance with the License. 62 | You may obtain a copy of the License at 63 | .LP 64 | http://www.apache.org/licenses/LICENSE-2.0 65 | .LP 66 | Unless required by applicable law or agreed to in writing, software 67 | distributed under the License is distributed on an "AS IS" BASIS, 68 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 69 | See the License for the specific language governing permissions and 70 | limitations under the License. 71 | -------------------------------------------------------------------------------- /doc/title.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Software Distribution with ESP Package Manager 4 | 5 | 6 | 7 | 8 | 9 | 10 |

 

11 | 12 |

 

13 | 14 |

 

15 | 16 |

 

17 | 18 |

 

19 | 20 |

 

21 | 22 |

 

23 | 24 |

 

25 | 26 |

 

27 | 28 |

EPM

29 | 30 |

Software Distribution
31 | with
32 | ESP Package Manager

33 | 34 |

MICHAEL R. SWEET

35 |

JIM JAGIELSKI

36 | 37 | 38 |

Software Distribution with ESP Package Manager

39 | 40 |

Copyright © 2020 by Jim Jagielski

41 |

Copyright © 2006-2020 by Michael R Sweet

42 |

Copyright © 2006-2010 by Easy Software Products

43 | 44 |

45 | Licensed under the Apache License, Version 2.0 (the "License"); 46 | you may not use this file except in compliance with the License. 47 | You may obtain a copy of the License at 48 |
49 | http://www.apache.org/licenses/LICENSE-2.0 50 |
51 | Unless required by applicable law or agreed to in writing, software 52 | distributed under the License is distributed on an "AS IS" BASIS, 53 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 54 | See the License for the specific language governing permissions and 55 | limitations under the License. 56 |

57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/title.opacity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/title.opacity -------------------------------------------------------------------------------- /doc/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimjag/epm/0bb1c140edf2802db4936f25e68cdb94a70c81fc/doc/title.png -------------------------------------------------------------------------------- /epm.list.in: -------------------------------------------------------------------------------- 1 | # 2 | # Sample software list file for the ESP Package Manager (EPM). 3 | # 4 | # Copyright © 2020 by Jim Jagielski 5 | # Copyright © 1999-2020 by Michael R Sweet 6 | # Copyright © 1999-2007 by Easy Software Products, all rights reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | # Directories... 21 | $prefix=@prefix@ 22 | $exec_prefix=@exec_prefix@ 23 | $bindir=@bindir@ 24 | $datarootdir=@datarootdir@ 25 | $datadir=@datadir@ 26 | $docdir=@docdir@ 27 | $libdir=@libdir@ 28 | $mandir=@mandir@ 29 | $srcdir=@srcdir@ 30 | 31 | # Product information 32 | %product ESP Package Manager (EPM) 33 | %copyright 2020 by Jim Jagielski, All Rights Reserved. 34 | %copyright 1999-2020 by Michael R Sweet, All Rights Reserved. 35 | %vendor Michael R Sweet, Jim Jagielski 36 | %license ${srcdir}/LICENSE 37 | %readme ${srcdir}/README.md 38 | %description Universal software packaging tool for UNIX. 39 | %version @VERSION@ @VERNUMBER@ 40 | 41 | # Executables 42 | %system all 43 | f 0555 root sys ${bindir}/epm epm 44 | f 0555 root sys ${bindir}/epminstall epminstall 45 | f 0555 root sys ${bindir}/mkepmlist mkepmlist 46 | 47 | # Documentation 48 | %subpackage documentation 49 | %description Documentation 50 | f 0444 root sys ${docdir}/README $srcdir/README.md 51 | f 0444 root sys ${docdir}/LICENSE $srcdir/LICENSE 52 | f 0444 root sys ${docdir}/epm-book.html $srcdir/doc/epm-book.html 53 | 54 | # Man pages 55 | %subpackage man 56 | %description Man pages 57 | d 0755 root sys ${mandir}/man1 - 58 | f 0444 root sys ${mandir}/man1/epm.1 $srcdir/doc/epm.1 59 | f 0444 root sys ${mandir}/man1/epminstall.1 $srcdir/doc/epminstall.1 60 | f 0444 root sys ${mandir}/man1/mkepmlist.1 $srcdir/doc/mkepmlist.1 61 | f 0444 root sys ${mandir}/man5/epm.list.5 $srcdir/doc/epm.list.5 62 | 63 | # GUI files... 64 | $GUIS=@GUIS@ 65 | 66 | %if GUIS 67 | %subpackage 68 | f 0555 root sys ${libdir}/epm/setup setup 69 | f 0555 root sys ${libdir}/epm/uninst uninst 70 | 71 | %system darwin 72 | f 0444 root sys ${datadir}/epm/default.icns default.icns 73 | %system all 74 | 75 | %subpackage man 76 | f 0444 root sys ${mandir}/man1/setup.1 $srcdir/doc/setup.1 77 | f 0444 root sys ${mandir}/man5/setup.types.5 $srcdir/doc/setup.types.5 78 | 79 | %endif 80 | -------------------------------------------------------------------------------- /epmstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * String definitions for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2005 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef _EPM_STRING_H_ 22 | #define _EPM_STRING_H_ 23 | 24 | /* 25 | * Include necessary headers... 26 | */ 27 | 28 | #include "config.h" 29 | #include 30 | #include 31 | 32 | #ifdef HAVE_STRINGS_H 33 | #include 34 | #endif /* HAVE_STRINGS_H */ 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | /* 41 | * Prototypes... 42 | */ 43 | 44 | #ifndef HAVE_STRDUP 45 | extern char *epm_strdup(const char *); 46 | #define strdup epm_strdup 47 | #endif /* !HAVE_STRDUP */ 48 | 49 | #ifndef HAVE_STRCASECMP 50 | extern int epm_strcasecmp(const char *, const char *); 51 | #define strcasecmp epm_strcasecmp 52 | #endif /* !HAVE_STRCASECMP */ 53 | 54 | #ifndef HAVE_STRNCASECMP 55 | extern int epm_strncasecmp(const char *, const char *, size_t n); 56 | #define strncasecmp epm_strncasecmp 57 | #endif /* !HAVE_STRNCASECMP */ 58 | 59 | #ifndef HAVE_STRLCAT 60 | extern size_t epm_strlcat(char *, const char *, size_t); 61 | #define strlcat epm_strlcat 62 | #endif /* !HAVE_STRLCAT */ 63 | 64 | #ifndef HAVE_STRLCPY 65 | extern size_t epm_strlcpy(char *, const char *, size_t); 66 | #define strlcpy epm_strlcpy 67 | #endif /* !HAVE_STRLCPY */ 68 | 69 | #ifndef HAVE_SNPRINTF 70 | extern int epm_snprintf(char *, size_t, const char *, ...) 71 | #ifdef __GNUC__ 72 | __attribute__((__format__(__printf__, 3, 4))) 73 | #endif /* __GNUC__ */ 74 | ; 75 | #define snprintf epm_snprintf 76 | #endif /* !HAVE_SNPRINTF */ 77 | 78 | #ifndef HAVE_VSNPRINTF 79 | extern int epm_vsnprintf(char *, size_t, const char *, va_list); 80 | #define vsnprintf epm_vsnprintf 81 | #endif /* !HAVE_VSNPRINTF */ 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif /* __cplusplus */ 86 | 87 | #endif /* !_EPM_STRING_H_ */ 88 | -------------------------------------------------------------------------------- /file.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File functions for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2017 by Michael R Sweet 6 | * Copyright 1999-2010 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epm.h" 26 | 27 | /* 28 | * 'copy_file()' - Copy a file. 29 | */ 30 | 31 | int /* O - 0 on success, -1 on failure */ 32 | copy_file(const char *dst, /* I - Destination file */ 33 | const char *src, /* I - Source file */ 34 | mode_t mode, /* I - Permissions */ 35 | uid_t owner, /* I - Owner ID */ 36 | gid_t group) /* I - Group ID */ 37 | { 38 | FILE *dstfile, /* Destination file */ 39 | *srcfile; /* Source file */ 40 | char buffer[8192]; /* Copy buffer */ 41 | char *slash; /* Pointer to trailing slash */ 42 | size_t bytes; /* Number of bytes read/written */ 43 | 44 | /* 45 | * Check that the destination directory exists... 46 | */ 47 | 48 | strlcpy(buffer, dst, sizeof(buffer)); 49 | if ((slash = strrchr(buffer, '/')) != NULL) 50 | *slash = '\0'; 51 | 52 | if (access(buffer, F_OK)) 53 | make_directory(buffer, 0755, owner, group); 54 | 55 | /* 56 | * Open files... 57 | */ 58 | 59 | if ((dstfile = fopen(dst, "wb")) == NULL) { 60 | fprintf(stderr, "epm: Unable to create \"%s\" -\n %s\n", dst, 61 | strerror(errno)); 62 | return (-1); 63 | } 64 | 65 | if ((srcfile = fopen(src, "rb")) == NULL) { 66 | fclose(dstfile); 67 | unlink(dst); 68 | 69 | fprintf(stderr, "epm: Unable to open \"%s\" -\n %s\n", src, strerror(errno)); 70 | return (-1); 71 | } 72 | 73 | /* 74 | * Copy from src to dst... 75 | */ 76 | 77 | while ((bytes = fread(buffer, 1, sizeof(buffer), srcfile)) > 0) 78 | if (fwrite(buffer, 1, bytes, dstfile) < bytes) { 79 | fprintf(stderr, "epm: Unable to write to \"%s\" -\n %s\n", dst, 80 | strerror(errno)); 81 | 82 | fclose(srcfile); 83 | fclose(dstfile); 84 | unlink(dst); 85 | 86 | return (-1); 87 | } 88 | 89 | /* 90 | * Close files, change permissions, and return... 91 | */ 92 | 93 | fclose(srcfile); 94 | fclose(dstfile); 95 | 96 | if (mode) 97 | chmod(dst, mode); 98 | if (!AooMode) 99 | if (owner != (uid_t)-1 && group != (gid_t)-1) 100 | chown(dst, owner, group); 101 | 102 | return (0); 103 | } 104 | 105 | /* 106 | * 'make_directory()' - Make a directory. 107 | */ 108 | 109 | int /* O - 0 = success, -1 = error */ 110 | make_directory(const char *directory, /* I - Directory */ 111 | mode_t mode, /* I - Permissions */ 112 | uid_t owner, /* I - Owner ID */ 113 | gid_t group) /* I - Group ID */ 114 | { 115 | char buffer[8192], /* Filename buffer */ 116 | *bufptr; /* Pointer into buffer */ 117 | 118 | for (bufptr = buffer; *directory;) { 119 | if (*directory == '/' && bufptr > buffer) { 120 | *bufptr = '\0'; 121 | 122 | if (access(buffer, F_OK)) { 123 | mkdir(buffer, 0755); 124 | if (mode) 125 | chmod(buffer, mode | 0700); 126 | if (!AooMode) 127 | if (owner != (uid_t)-1 && group != (gid_t)-1) 128 | chown(buffer, owner, group); 129 | } 130 | } 131 | 132 | *bufptr++ = *directory++; 133 | } 134 | 135 | *bufptr = '\0'; 136 | 137 | if (access(buffer, F_OK)) { 138 | mkdir(buffer, 0755); 139 | if (mode) 140 | chmod(buffer, mode | 0700); 141 | if (!AooMode) 142 | if (owner != (uid_t)-1 && group != (gid_t)-1) 143 | chown(buffer, owner, group); 144 | } 145 | 146 | return (0); 147 | } 148 | 149 | /* 150 | * 'make_link()' - Make a symbolic link. 151 | */ 152 | 153 | int /* O - 0 = success, -1 = error */ 154 | make_link(const char *dst, /* I - Destination file */ 155 | const char *src) /* I - Link */ 156 | { 157 | char buffer[8192], /* Copy buffer */ 158 | *slash; /* Pointer to trailing slash */ 159 | 160 | /* 161 | * Check that the destination directory exists... 162 | */ 163 | 164 | strlcpy(buffer, dst, sizeof(buffer)); 165 | if ((slash = strrchr(buffer, '/')) != NULL) 166 | *slash = '\0'; 167 | 168 | if (access(buffer, F_OK)) 169 | make_directory(buffer, 0755, 0, 0); 170 | 171 | /* 172 | * Make the symlink... 173 | */ 174 | 175 | return (symlink(src, dst)); 176 | } 177 | 178 | /* 179 | * 'strip_execs()' - Strip symbols from executable files in the distribution. 180 | */ 181 | 182 | void strip_execs(dist_t *dist) /* I - Distribution to strip... */ 183 | { 184 | int i; /* Looping var */ 185 | file_t *file; /* Software file */ 186 | FILE *fp; /* File pointer */ 187 | char header[4]; /* File header... */ 188 | 189 | /* 190 | * Loop through the distribution files and strip any executable 191 | * files. 192 | */ 193 | 194 | for (i = dist->num_files, file = dist->files; i > 0; i--, file++) 195 | if (tolower(file->type) == 'f' && (file->mode & 0111) && 196 | strstr(file->options, "nostrip()") == NULL) { 197 | /* 198 | * OK, this file has executable permissions; see if it is a 199 | * script... 200 | */ 201 | 202 | if ((fp = fopen(file->src, "rb")) != NULL) { 203 | /* 204 | * Read the first 3 bytes of the file... 205 | */ 206 | 207 | if (fread(header, 1, sizeof(header) - 1, fp) == 0) 208 | continue; 209 | 210 | header[sizeof(header) - 1] = '\0'; 211 | 212 | fclose(fp); 213 | 214 | /* 215 | * Check for "#!/" or "#" + whitespace at the beginning of the file... 216 | */ 217 | 218 | if (!strncmp(header, "#!/", 3) || 219 | (header[0] == '#' && isspace(header[1] & 255))) 220 | continue; 221 | } else { 222 | /* 223 | * File could not be opened; error out... 224 | */ 225 | 226 | fprintf(stderr, 227 | "epm: Unable to open file \"%s\" for destination " 228 | "\"%s\" -\n %s\n", 229 | file->src, file->dst, strerror(errno)); 230 | 231 | exit(1); 232 | } 233 | 234 | /* 235 | * Strip executables... 236 | */ 237 | 238 | run_command(NULL, EPM_STRIP " %s", file->src); 239 | } 240 | } 241 | 242 | /* 243 | * 'unlink_directory()' - Delete a directory and all of its nodes. 244 | */ 245 | 246 | int /* O - 0 on success, -1 on failure */ 247 | unlink_directory(const char *directory) /* I - Directory */ 248 | { 249 | DIR *dir; /* Directory */ 250 | DIRENT *dent; /* Directory entry */ 251 | char filename[1024]; /* Filename */ 252 | struct stat fileinfo; /* Information on the source file */ 253 | 254 | /* 255 | * Try opening the source directory... 256 | */ 257 | 258 | if ((dir = opendir(directory)) == NULL) { 259 | fprintf(stderr, "epm: Unable to open directory \"%s\": %s\n", directory, 260 | strerror(errno)); 261 | 262 | return (-1); 263 | } 264 | 265 | /* 266 | * Read from the directory... 267 | */ 268 | 269 | while ((dent = readdir(dir)) != NULL) { 270 | /* 271 | * Skip "." and ".."... 272 | */ 273 | 274 | if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) 275 | continue; 276 | 277 | /* 278 | * Get file info... 279 | */ 280 | 281 | snprintf(filename, sizeof(filename), "%s/%s", directory, dent->d_name); 282 | 283 | if (lstat(filename, &fileinfo)) { 284 | fprintf(stderr, "epm: Unable to stat \"%s\": %s\n", filename, 285 | strerror(errno)); 286 | continue; 287 | } 288 | 289 | /* 290 | * Process accordingly... 291 | */ 292 | 293 | if (Verbosity) 294 | puts(filename); 295 | 296 | if (S_ISDIR(fileinfo.st_mode)) { 297 | /* 298 | * Directory... 299 | */ 300 | 301 | if (unlink_directory(filename)) 302 | goto fail; 303 | } else { 304 | /* 305 | * Regular file or symlink... 306 | */ 307 | 308 | if (unlink(filename)) { 309 | fprintf(stderr, "epm: Unable to remove \"%s\": %s\n", filename, 310 | strerror(errno)); 311 | goto fail; 312 | } 313 | } 314 | } 315 | 316 | closedir(dir); 317 | 318 | if (rmdir(directory)) { 319 | fprintf(stderr, "epm: Unable to remove \"%s\": %s\n", directory, strerror(errno)); 320 | return (-1); 321 | } 322 | 323 | return (0); 324 | 325 | fail: 326 | 327 | closedir(dir); 328 | return (-1); 329 | } 330 | 331 | /* 332 | * 'unlink_package()' - Delete a package file. 333 | */ 334 | 335 | int /* O - 0 on success, -1 on failure */ 336 | unlink_package(const char *ext, /* I - Package filename extension */ 337 | const char *prodname, /* I - Product short name */ 338 | const char *directory, /* I - Directory for distribution files */ 339 | const char *platname, /* I - Platform name */ 340 | dist_t *dist, /* I - Distribution information */ 341 | const char *subpackage) /* I - Subpackage */ 342 | { 343 | char prodfull[255], /* Full name of product */ 344 | name[1024], /* Full product name */ 345 | filename[1024]; /* File to archive */ 346 | 347 | /* 348 | * Figure out the full name of the distribution... 349 | */ 350 | 351 | if (subpackage) 352 | snprintf(prodfull, sizeof(prodfull), "%s-%s", prodname, subpackage); 353 | else 354 | strlcpy(prodfull, prodname, sizeof(prodfull)); 355 | 356 | /* 357 | * Then the subdirectory name... 358 | */ 359 | 360 | if (dist->release[0]) 361 | snprintf(name, sizeof(name), "%s-%s-%s", prodfull, dist->version, dist->release); 362 | else 363 | snprintf(name, sizeof(name), "%s-%s", prodfull, dist->version); 364 | 365 | if (platname[0]) { 366 | strlcat(name, "-", sizeof(name)); 367 | strlcat(name, platname, sizeof(name)); 368 | } 369 | 370 | strlcat(name, ".", sizeof(name)); 371 | strlcat(name, ext, sizeof(name)); 372 | 373 | /* 374 | * Remove the package file... 375 | */ 376 | 377 | snprintf(filename, sizeof(filename), "%s/%s", directory, name); 378 | 379 | if (unlink(filename)) { 380 | fprintf(stderr, "epm: Unable to remove \"%s\": %s\n", filename, strerror(errno)); 381 | return (-1); 382 | } else 383 | return (0); 384 | } 385 | -------------------------------------------------------------------------------- /gui-common.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // ESP Software Wizard common functions for the ESP Package Manager (EPM). 3 | // 4 | // Copyright © 2020 by Jim Jagielski 5 | // Copyright 1999-2014 by Michael R Sweet 6 | // Copyright 1999-2006 by Easy Software Products. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | #include "gui-common.h" 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | // 32 | // 'gui_add_depend()' - Add a dependency to a distribution. 33 | // 34 | 35 | void gui_add_depend(gui_dist_t *d, // I - Distribution 36 | int type, // I - Dependency type 37 | const char *name, // I - Name of product 38 | int lowver, // I - Lower version number 39 | int hiver) // I - Highre version number 40 | { 41 | gui_depend_t *temp; // Pointer to dependency 42 | 43 | if (d->num_depends == 0) 44 | temp = (gui_depend_t *)malloc(sizeof(gui_depend_t)); 45 | else 46 | temp = (gui_depend_t *)realloc(d->depends, 47 | sizeof(gui_depend_t) * (d->num_depends + 1)); 48 | 49 | if (temp == NULL) { 50 | perror("setup: Unable to allocate memory for dependency"); 51 | exit(1); 52 | } 53 | 54 | d->depends = temp; 55 | temp += d->num_depends; 56 | d->num_depends++; 57 | 58 | memset(temp, 0, sizeof(gui_depend_t)); 59 | strncpy(temp->product, name, sizeof(temp->product) - 1); 60 | temp->type = type; 61 | temp->vernumber[0] = lowver; 62 | temp->vernumber[1] = hiver; 63 | } 64 | 65 | // 66 | // 'gui_add_dist()' - Add a distribution. 67 | // 68 | 69 | gui_dist_t * // O - New distribution 70 | gui_add_dist(int *num_d, // IO - Number of distributions 71 | gui_dist_t **d) // IO - Distributions 72 | { 73 | gui_dist_t *temp; // Pointer to current distribution 74 | 75 | // Add a new distribution entry... 76 | if (*num_d == 0) 77 | temp = (gui_dist_t *)malloc(sizeof(gui_dist_t)); 78 | else 79 | temp = (gui_dist_t *)realloc(*d, sizeof(gui_dist_t) * (*num_d + 1)); 80 | 81 | if (temp == NULL) { 82 | perror("setup: Unable to allocate memory for distribution"); 83 | exit(1); 84 | } 85 | 86 | *d = temp; 87 | temp += *num_d; 88 | (*num_d)++; 89 | 90 | memset(temp, 0, sizeof(gui_dist_t)); 91 | 92 | return (temp); 93 | } 94 | 95 | // 96 | // 'gui_find_dist()' - Find a distribution. 97 | // 98 | 99 | gui_dist_t * // O - Pointer to distribution or NULL 100 | gui_find_dist(const char *name, // I - Distribution name 101 | int num_d, // I - Number of distributions 102 | gui_dist_t *d) // I - Distributions 103 | { 104 | while (num_d > 0) { 105 | if (!strcmp(name, d->product)) 106 | return (d); 107 | 108 | d++; 109 | num_d--; 110 | } 111 | 112 | return (NULL); 113 | } 114 | 115 | // 116 | // 'gui_get_installed()' - Get a list of installed software products. 117 | // 118 | 119 | void gui_get_installed(void) { 120 | int i; // Looping var 121 | int num_files; // Number of files 122 | dirent **files; // Files 123 | const char *ext; // Extension 124 | gui_dist_t *temp; // Pointer to current distribution 125 | FILE *fp; // File to read from 126 | char line[1024]; // Line from file... 127 | 128 | // See if there are any installed files... 129 | NumInstalled = 0; 130 | Installed = (gui_dist_t *)0; 131 | 132 | if ((num_files = fl_filename_list(EPM_SOFTWARE, &files)) > 0) { 133 | // Build a distribution list... 134 | for (i = 0; i < num_files; i++) { 135 | ext = fl_filename_ext(files[i]->d_name); 136 | 137 | if (!strcmp(ext, ".remove")) { 138 | // Found a .remove script... 139 | snprintf(line, sizeof(line), EPM_SOFTWARE "/%s", files[i]->d_name); 140 | if ((fp = fopen(line, "r")) == NULL) { 141 | perror("setup: Unable to open removal script"); 142 | exit(1); 143 | } 144 | 145 | // Add a new distribution entry... 146 | temp = gui_add_dist(&NumInstalled, &Installed); 147 | temp->type = PACKAGE_PORTABLE; 148 | 149 | strncpy(temp->product, files[i]->d_name, sizeof(temp->product) - 1); 150 | *strrchr(temp->product, '.') = '\0'; // Drop .remove 151 | 152 | // Read info from the removal script... 153 | while (fgets(line, sizeof(line), fp)) { 154 | // Only read distribution info lines... 155 | if (strncmp(line, "#%", 2)) 156 | continue; 157 | 158 | // Drop the trailing newline... 159 | line[strlen(line) - 1] = '\0'; 160 | 161 | // Copy data as needed... 162 | if (!strncmp(line, "#%product ", 10)) 163 | strncpy(temp->name, line + 10, sizeof(temp->name) - 1); 164 | else if (!strncmp(line, "#%version ", 10)) 165 | sscanf(line + 10, "%31s%d", temp->version, &(temp->vernumber)); 166 | else if (!strncmp(line, "#%rootsize ", 11)) 167 | temp->rootsize = atoi(line + 11); 168 | else if (!strncmp(line, "#%usrsize ", 10)) 169 | temp->usrsize = atoi(line + 10); 170 | } 171 | 172 | fclose(fp); 173 | } 174 | 175 | free(files[i]); 176 | } 177 | 178 | free(files); 179 | } 180 | 181 | // Get a list of RPM packages that are installed... 182 | if (!access("/bin/rpm", 0) && 183 | (fp = popen("/bin/rpm -qa --qf " 184 | "'%{NAME}|%{VERSION}|%{SIZE}|%{SUMMARY}\\n'", 185 | "r")) != NULL) { 186 | char *version, // Version number 187 | *size, // Size of package 188 | *description; // Summary string 189 | 190 | while (fgets(line, sizeof(line), fp)) { 191 | // Drop the trailing newline... 192 | line[strlen(line) - 1] = '\0'; 193 | 194 | // Grab the different fields... 195 | if ((version = strchr(line, '|')) == NULL) 196 | continue; 197 | *version++ = '\0'; 198 | 199 | if ((size = strchr(version, '|')) == NULL) 200 | continue; 201 | *size++ = '\0'; 202 | 203 | if ((description = strchr(size, '|')) == NULL) 204 | continue; 205 | *description++ = '\0'; 206 | 207 | // Add a new distribution entry... 208 | temp = gui_add_dist(&NumInstalled, &Installed); 209 | temp->type = PACKAGE_RPM; 210 | 211 | strlcpy(temp->product, line, sizeof(temp->product)); 212 | strlcpy(temp->name, description, sizeof(temp->name)); 213 | strlcpy(temp->version, version, sizeof(temp->version)); 214 | temp->vernumber = get_vernumber(version); 215 | temp->rootsize = (int)(atof(size) / 1024.0 + 0.5); 216 | } 217 | 218 | pclose(fp); 219 | } 220 | 221 | if (NumInstalled > 1) 222 | qsort(Installed, NumInstalled, sizeof(gui_dist_t), 223 | (compare_func_t)gui_sort_dists); 224 | } 225 | 226 | // 227 | // 'gui_load_file()' - Load a file into a help widget. 228 | // 229 | 230 | void gui_load_file(Fl_Help_View *hv, // I - Help widget 231 | const char *filename) // I - File to load 232 | { 233 | FILE *fp; // File pointer 234 | struct stat info; // Info about file 235 | int ch; // Character from file 236 | char *buffer, // File buffer 237 | *ptr; // Pointer into buffer 238 | 239 | // Try opening the file and getting the file size... 240 | if ((fp = fopen(filename, "r")) == NULL) { 241 | hv->value(strerror(errno)); 242 | return; 243 | } 244 | 245 | if (stat(filename, &info)) { 246 | hv->value(strerror(errno)); 247 | return; 248 | } 249 | 250 | // Allocate a buffer that is more than big enough to the hold the file... 251 | buffer = new char[info.st_size * 2]; 252 | 253 | // See if we have a HTML file... 254 | if ((ch = getc(fp)) == '<') { 255 | // Yes, just read it in... 256 | buffer[0] = ch; 257 | fread(buffer + 1, 1, info.st_size - 1, fp); 258 | buffer[info.st_size] = '\0'; 259 | } else { 260 | // No, treat it as plain text... 261 | ungetc(ch, fp); 262 | 263 | strcpy(buffer, "
");
264 | 
265 |         ptr = buffer + 5;
266 | 
267 |         while ((ch = getc(fp)) != EOF) {
268 |             if (ch == '&') {
269 |                 strcpy(ptr, "&");
270 |                 ptr += 5;
271 |             } else if (ch == '<') {
272 |                 strcpy(ptr, "<");
273 |                 ptr += 4;
274 |             } else
275 |                 *ptr++ = ch;
276 |         }
277 | 
278 |         strcpy(ptr, "
\n"); 279 | 280 | // Preformatted text will be too large without a reduction in the 281 | // base size... 282 | hv->textsize(10); 283 | } 284 | 285 | // Save the loaded buffer to the help widget... 286 | hv->value(buffer); 287 | 288 | // Free memory and close the file... 289 | delete[] buffer; 290 | fclose(fp); 291 | } 292 | 293 | // 294 | // 'gui_sort_dists()' - Compare two distribution names... 295 | // 296 | 297 | int // O - Result of comparison 298 | gui_sort_dists(const gui_dist_t *d0, // I - First distribution 299 | const gui_dist_t *d1) // I - Second distribution 300 | { 301 | return (strcmp(d0->name, d1->name)); 302 | } 303 | -------------------------------------------------------------------------------- /gui-common.h: -------------------------------------------------------------------------------- 1 | // 2 | // ESP Software Wizard common header file for the ESP Package Manager (EPM). 3 | // 4 | // Copyright © 2020 by Jim Jagielski 5 | // Copyright 1999-2014 by Michael R Sweet 6 | // Copyright 1999-2006 by Easy Software Products. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | #ifndef _GUI_COMMON_H_ 22 | #define _GUI_COMMON_H_ 23 | 24 | // 25 | // Include necessary headers... 26 | // 27 | 28 | #include "epm.h" 29 | #include "epmstring.h" 30 | #include 31 | #include 32 | #include 33 | 34 | // 35 | // Distribution structures... 36 | // 37 | 38 | struct gui_depend_t //// Dependencies 39 | { 40 | int type; // Type of dependency 41 | char product[64]; // Name of product or file 42 | int vernumber[2]; // Version number(s) 43 | }; 44 | 45 | struct gui_dist_t //// Distributions 46 | { 47 | int type; // Package type 48 | char product[64]; // Product name 49 | char name[256]; // Product long name 50 | char version[32]; // Product version 51 | int vernumber; // Version number 52 | int num_depends; // Number of dependencies 53 | gui_depend_t *depends; // Dependencies 54 | int rootsize, // Size of root partition files in kbytes 55 | usrsize; // Size of /usr partition files in kbytes 56 | char *filename; // Name of package file 57 | }; 58 | 59 | struct gui_intype_t //// Installation types 60 | { 61 | char name[80]; // Type name 62 | char label[80]; // Type label 63 | int num_products; // Number of products to install (0 = select) 64 | int products[200]; // Products to install 65 | int size; // Size of products in kbytes 66 | }; 67 | 68 | // 69 | // Define a C API function type for comparisons... 70 | // 71 | 72 | extern "C" { 73 | typedef int (*compare_func_t)(const void *, const void *); 74 | } 75 | 76 | // 77 | // Globals... 78 | // 79 | 80 | #ifdef _DEFINE_GLOBALS_ 81 | #define VAR 82 | #else 83 | #define VAR extern 84 | #endif // _DEFINE_GLOBALS_ 85 | 86 | VAR int NumDists; // Number of distributions in directory 87 | VAR gui_dist_t *Dists; // Distributions in directory 88 | VAR int NumInstalled; // Number of distributions installed 89 | VAR gui_dist_t *Installed; // Distributions installed 90 | VAR int NumInstTypes; // Number of installation types 91 | VAR gui_intype_t InstTypes[8]; // Installation types 92 | 93 | // 94 | // Prototypes... 95 | // 96 | 97 | void gui_add_depend(gui_dist_t *d, int type, const char *name, int lowver, int hiver); 98 | gui_dist_t *gui_add_dist(int *num_d, gui_dist_t **d); 99 | gui_dist_t *gui_find_dist(const char *name, int num_d, gui_dist_t *d); 100 | void gui_get_installed(void); 101 | void gui_load_file(Fl_Help_View *hv, const char *filename); 102 | int gui_sort_dists(const gui_dist_t *d0, const gui_dist_t *d1); 103 | 104 | #endif // !_GUI_COMMON_H_ 105 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Install a program, script, or datafile. 4 | # 5 | # Copyright 2008-2012 by Apple Inc. 6 | # 7 | # This script is not compatible with BSD (or any other) install program, as it 8 | # allows owner and group changes to fail with a warning and makes sure that the 9 | # destination directory permissions are as specified - BSD install and the 10 | # original X11 install script did not change permissions of existing 11 | # directories. It also does not support the transform options since CUPS does 12 | # not use them... 13 | # 14 | # Original script from X11R5 (mit/util/scripts/install.sh) 15 | # Copyright 1991 by the Massachusetts Institute of Technology 16 | # 17 | # Permission to use, copy, modify, distribute, and sell this software and its 18 | # documentation for any purpose is hereby granted without fee, provided that 19 | # the above copyright notice appear in all copies and that both that 20 | # copyright notice and this permission notice appear in supporting 21 | # documentation, and that the name of M.I.T. not be used in advertising or 22 | # publicity pertaining to distribution of the software without specific, 23 | # written prior permission. M.I.T. makes no representations about the 24 | # suitability of this software for any purpose. It is provided "as is" 25 | # without express or implied warranty. 26 | # 27 | # Calling this script install-sh is preferred over install.sh, to prevent 28 | # `make' implicit rules from creating a file called install from it 29 | # when there is no Makefile. 30 | 31 | # set DOITPROG to echo to test this script 32 | # Don't use :- since 4.3BSD and earlier shells don't like it. 33 | doit="${DOITPROG-}" 34 | 35 | # Force umask to 022... 36 | umask 022 37 | 38 | # put in absolute paths if you don't have them in your path; or use env. vars. 39 | mvprog="${MVPROG-mv}" 40 | cpprog="${CPPROG-cp}" 41 | chmodprog="${CHMODPROG-chmod}" 42 | chownprog="${CHOWNPROG-chown}" 43 | chgrpprog="${CHGRPPROG-chgrp}" 44 | stripprog="${STRIPPROG-strip}" 45 | rmprog="${RMPROG-rm}" 46 | mkdirprog="${MKDIRPROG-mkdir}" 47 | gzipprog="${GZIPPROG-gzip}" 48 | 49 | transformbasename="" 50 | transform_arg="" 51 | instcmd="$mvprog" 52 | chmodcmd="$chmodprog 0755" 53 | chowncmd="" 54 | chgrpcmd="" 55 | stripcmd="" 56 | rmcmd="$rmprog -f" 57 | mvcmd="$mvprog" 58 | src="" 59 | dst="" 60 | dir_arg="" 61 | 62 | gzipcp() { 63 | # gzipcp from to 64 | $gzipprog -9 <"$1" >"$2" 65 | } 66 | 67 | while [ x"$1" != x ]; do 68 | case $1 in 69 | -c) 70 | instcmd="$cpprog" 71 | shift 72 | continue 73 | ;; 74 | 75 | -d) 76 | dir_arg=true 77 | shift 78 | continue 79 | ;; 80 | 81 | -m) 82 | chmodcmd="$chmodprog $2" 83 | shift 84 | shift 85 | continue 86 | ;; 87 | 88 | -o) 89 | chowncmd="$chownprog $2" 90 | shift 91 | shift 92 | continue 93 | ;; 94 | 95 | -g) 96 | chgrpcmd="$chgrpprog $2" 97 | shift 98 | shift 99 | continue 100 | ;; 101 | 102 | -s) 103 | stripcmd="$stripprog" 104 | shift 105 | continue 106 | ;; 107 | 108 | -z) 109 | instcmd="gzipcp" 110 | shift 111 | continue 112 | ;; 113 | 114 | *) 115 | if [ x"$src" = x ]; then 116 | src="$1" 117 | else 118 | dst="$1" 119 | fi 120 | shift 121 | continue 122 | ;; 123 | esac 124 | done 125 | 126 | if [ x"$src" = x ]; then 127 | echo "install-sh: No input file specified" 128 | exit 1 129 | fi 130 | 131 | if [ x"$dir_arg" != x ]; then 132 | dst="$src" 133 | src="" 134 | 135 | if [ -d "$dst" ]; then 136 | instcmd=: 137 | else 138 | instcmd=$mkdirprog 139 | fi 140 | else 141 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 142 | # might cause directories to be created, which would be especially bad 143 | # if $src (and thus $dsttmp) contains '*'. 144 | if [ ! -f "$src" -a ! -d "$src" ]; then 145 | echo "install: $src does not exist" 146 | exit 1 147 | fi 148 | 149 | if [ x"$dst" = x ]; then 150 | echo "install: No destination specified" 151 | exit 1 152 | fi 153 | 154 | # If destination is a directory, append the input filename. 155 | if [ -d "$dst" ]; then 156 | dst="$dst/`basename $src`" 157 | fi 158 | fi 159 | 160 | ## this sed command emulates the dirname command 161 | dstdir="`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`" 162 | 163 | # Make sure that the destination directory exists. 164 | # This part is taken from Noah Friedman's mkinstalldirs script 165 | 166 | # Skip lots of stat calls in the usual case. 167 | if [ ! -d "$dstdir" ]; then 168 | defaultIFS=' 169 | ' 170 | IFS="${IFS-${defaultIFS}}" 171 | 172 | oIFS="${IFS}" 173 | # Some sh's can't handle IFS=/ for some reason. 174 | IFS='%' 175 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 176 | IFS="${oIFS}" 177 | 178 | pathcomp='' 179 | 180 | while [ $# -ne 0 ] ; do 181 | pathcomp="${pathcomp}${1}" 182 | shift 183 | 184 | if [ ! -d "${pathcomp}" ]; then $doit $mkdirprog "${pathcomp}"; fi 185 | 186 | pathcomp="${pathcomp}/" 187 | done 188 | fi 189 | 190 | if [ x"$dir_arg" != x ]; then 191 | # Make a directory... 192 | $doit $instcmd $dst || exit 1 193 | 194 | # Allow chown/chgrp to fail, but log a warning 195 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst || echo "warning: Unable to change owner of $dst!"; fi 196 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst || echo "warning: Unable to change group of $dst!"; fi 197 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst || exit 1; fi 198 | else 199 | # Install a file... 200 | dstfile="`basename $dst`" 201 | 202 | # Check the destination file - for libraries just use the "-x" option 203 | # to strip... 204 | case "$dstfile" in 205 | *.a | *.dylib | *.sl | *.sl.* | *.so | *.so.*) 206 | stripopt="-x" 207 | ;; 208 | *) 209 | stripopt="" 210 | ;; 211 | esac 212 | 213 | # Make a temp file name in the proper directory. 214 | dsttmp="$dstdir/#inst.$$#" 215 | 216 | # Move or copy the file name to the temp name 217 | $doit $instcmd $src $dsttmp || exit 1 218 | 219 | # Update permissions and strip as needed, then move to the final name. 220 | # If the chmod, strip, rm, or mv commands fail, remove the installed 221 | # file... 222 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $stripopt "$dsttmp" || echo "warning: Unable to strip $dst!"; fi 223 | if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp" || echo "warning: Unable to change owner of $dst!"; fi 224 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp" || echo "warning: Unable to change group of $dst!"; fi 225 | 226 | trap "rm -f ${dsttmp}" 0 && 227 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; fi && 228 | $doit $rmcmd -f "$dstdir/$dstfile" && 229 | $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" 230 | fi 231 | 232 | exit 0 233 | -------------------------------------------------------------------------------- /makesrcdist: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # makesrcdist - make a source distribution of EPM. 4 | # 5 | 6 | if test $# != 1; then 7 | echo "Usage: ./makesrcdist version" 8 | exit 1 9 | fi 10 | 11 | version=$1 12 | 13 | echo Creating tag for release... 14 | git tag -m "Tag $version" v$version 15 | git push origin v$version 16 | 17 | echo Creating epm-$version-source.tar.gz... 18 | git archive --format tar HEAD | gzip -v9 >epm-$version-source.tar.gz 19 | -------------------------------------------------------------------------------- /qprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Quoted fprintf function for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2009 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epm.h" 26 | #include "epmstring.h" 27 | #include 28 | #include 29 | 30 | /* 31 | * 'qprintf()' - Do formatted output to a file. 32 | */ 33 | 34 | int /* O - Number of bytes formatted */ 35 | qprintf(FILE *fp, /* I - File to write to */ 36 | const char *format, /* I - printf-style format string */ 37 | ...) /* I - Additional args as needed... */ 38 | { 39 | va_list ap; /* Pointer to additional arguments */ 40 | int bytes; /* Bytes written */ 41 | char sign, /* Sign of format width */ 42 | size, /* Size character (h, l, L) */ 43 | type; /* Format type character */ 44 | const char *bufformat; /* Start of format */ 45 | int width, /* Width of field */ 46 | prec; /* Number of characters of precision */ 47 | char tformat[100]; /* Temporary format string for fprintf() */ 48 | char *s; /* Pointer to string */ 49 | int slen; /* Length of string */ 50 | int i; /* Looping var */ 51 | char *pattern = "`~#$%^&*()[{]}\\|;\'\"<>? "; 52 | 53 | #if defined(__FreeBSD__) 54 | if (AooMode) 55 | pattern = "`~!#%^&*()[{]}\\|;\'\"<>? "; 56 | #endif 57 | /* 58 | * Loop through the format string, formatting as needed... 59 | */ 60 | 61 | va_start(ap, format); 62 | 63 | bytes = 0; 64 | 65 | while (*format) { 66 | if (*format == '%') { 67 | bufformat = format; 68 | format++; 69 | 70 | if (*format == '%') { 71 | putc(*format++, fp); 72 | bytes++; 73 | continue; 74 | } else if (strchr(" -+#\'", *format)) 75 | sign = *format++; 76 | else 77 | sign = 0; 78 | 79 | width = 0; 80 | while (isdigit(*format & 255)) 81 | width = width * 10 + *format++ - '0'; 82 | 83 | if (*format == '.') { 84 | format++; 85 | prec = 0; 86 | 87 | while (isdigit(*format & 255)) 88 | prec = prec * 10 + *format++ - '0'; 89 | } else 90 | prec = -1; 91 | 92 | if (*format == 'l') 93 | size = *format++; 94 | else 95 | size = '\0'; 96 | 97 | if (!*format) 98 | break; 99 | 100 | type = *format++; 101 | 102 | switch (type) { 103 | case 'E': /* Floating point formats */ 104 | case 'G': 105 | case 'e': 106 | case 'f': 107 | case 'g': 108 | if ((format - bufformat + 1) > sizeof(tformat)) 109 | break; 110 | 111 | strlcpy(tformat, bufformat, (size_t)(format - bufformat + 1)); 112 | 113 | bytes += fprintf(fp, tformat, va_arg(ap, double)); 114 | break; 115 | 116 | case 'B': /* Integer formats */ 117 | case 'X': 118 | case 'b': 119 | case 'd': 120 | case 'i': 121 | case 'o': 122 | case 'u': 123 | case 'x': 124 | if ((format - bufformat + 1) > sizeof(tformat)) 125 | break; 126 | 127 | strlcpy(tformat, bufformat, (size_t)(format - bufformat + 1)); 128 | 129 | if (size == 'l') 130 | bytes += fprintf(fp, tformat, va_arg(ap, long)); 131 | else 132 | bytes += fprintf(fp, tformat, va_arg(ap, int)); 133 | break; 134 | 135 | case 'p': /* Pointer value */ 136 | if ((format - bufformat + 1) > sizeof(tformat)) 137 | break; 138 | 139 | strlcpy(tformat, bufformat, (size_t)(format - bufformat + 1)); 140 | 141 | bytes += fprintf(fp, tformat, va_arg(ap, void *)); 142 | break; 143 | 144 | case 'c': /* Character or character array */ 145 | if (width <= 1) { 146 | bytes++; 147 | putc(va_arg(ap, int), fp); 148 | } else { 149 | fwrite(va_arg(ap, char *), 1, (size_t)width, fp); 150 | bytes += width; 151 | } 152 | break; 153 | 154 | case 's': /* String */ 155 | if ((s = va_arg(ap, char *)) == NULL) 156 | s = "(null)"; 157 | 158 | slen = (int)strlen(s); 159 | if (slen > width && prec != width) 160 | width = slen; 161 | 162 | if (slen > width) 163 | slen = width; 164 | 165 | if (sign != '-') { 166 | for (i = width - slen; i > 0; i--, bytes++) 167 | putc(' ', fp); 168 | } 169 | 170 | for (i = slen; i > 0; i--, s++, bytes++) { 171 | if (strchr(pattern, *s)) { 172 | putc('\\', fp); 173 | bytes++; 174 | } 175 | putc(*s, fp); 176 | } 177 | 178 | if (sign == '-') { 179 | for (i = width - slen; i > 0; i--, bytes++) 180 | putc(' ', fp); 181 | } 182 | break; 183 | } 184 | } else { 185 | putc(*format++, fp); 186 | bytes++; 187 | } 188 | } 189 | 190 | va_end(ap); 191 | 192 | /* 193 | * Return the number of characters written. 194 | */ 195 | 196 | return (bytes); 197 | } 198 | -------------------------------------------------------------------------------- /run.c: -------------------------------------------------------------------------------- 1 | /* 2 | * External program function for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2005 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epm.h" 26 | #include 27 | #include 28 | #include 29 | 30 | /* 31 | * 'run_command()' - Run an external program. 32 | */ 33 | 34 | int /* O - Exit status */ 35 | run_command(const char *directory, /* I - Directory for command or NULL */ 36 | const char *command, /* I - Command string */ 37 | ...) /* I - Additional arguments as needed */ 38 | { 39 | va_list ap; /* Argument pointer */ 40 | int pid, /* Child process ID */ 41 | status, /* Status of child */ 42 | argc; /* Number of arguments */ 43 | char argbuf[10240], /* Argument buffer */ 44 | *argptr, /* Argument string pointer */ 45 | *argv[100]; /* Argument strings */ 46 | 47 | /* 48 | * Format the command string... 49 | */ 50 | 51 | va_start(ap, command); 52 | vsnprintf(argbuf, sizeof(argbuf) - 1, command, ap); 53 | argbuf[sizeof(argbuf) - 1] = '\0'; 54 | 55 | if (Verbosity > 1) 56 | puts(argbuf); 57 | 58 | /* 59 | * Parse the argument string; arguments can be separated by whitespace 60 | * and quoted by " and '... 61 | */ 62 | 63 | argv[0] = argbuf; 64 | 65 | for (argptr = argbuf, argc = 1; *argptr != '\0' && argc < 99; argptr++) 66 | if (isspace(*argptr & 255)) { 67 | *argptr++ = '\0'; 68 | 69 | while (isspace(*argptr & 255)) 70 | argptr++; 71 | 72 | if (*argptr != '\0') { 73 | argv[argc] = argptr; 74 | argc++; 75 | } 76 | 77 | argptr--; 78 | } else if (*argptr == '\'') { 79 | if (argptr == argv[argc - 1]) 80 | argv[argc - 1]++; 81 | 82 | for (argptr++; *argptr && *argptr != '\''; argptr++) 83 | if (*argptr == '\\' && argptr[1]) 84 | memmove(argptr, argptr + 1, strlen(argptr)); 85 | 86 | if (*argptr == '\'') 87 | memmove(argptr, argptr + 1, strlen(argptr)); 88 | 89 | argptr--; 90 | } else if (*argptr == '\"') { 91 | if (argptr == argv[argc - 1]) 92 | argv[argc - 1]++; 93 | 94 | for (argptr++; *argptr && *argptr != '\"'; argptr++) 95 | if (*argptr == '\\' && argptr[1]) 96 | memmove(argptr, argptr + 1, strlen(argptr)); 97 | 98 | if (*argptr == '\"') 99 | memmove(argptr, argptr + 1, strlen(argptr)); 100 | 101 | argptr--; 102 | } 103 | 104 | argv[argc] = NULL; 105 | 106 | /* 107 | * Execute the command... 108 | */ 109 | 110 | if ((pid = fork()) == 0) { 111 | /* 112 | * Child comes here... Redirect stdin, stdout, and stderr to /dev/null 113 | * if !Verbosity... 114 | */ 115 | 116 | if (Verbosity < 2) { 117 | close(0); 118 | close(1); 119 | close(2); 120 | 121 | open("/dev/null", O_RDWR); 122 | dup(0); 123 | dup(0); 124 | } 125 | 126 | /* 127 | * Change directories... 128 | */ 129 | 130 | if (directory) 131 | chdir(directory); 132 | 133 | /* 134 | * Execute the program; if an error occurs, exit with the UNIX error... 135 | */ 136 | 137 | execvp(argv[0], argv); 138 | fprintf(stderr, "epm: Unable to execute \"%s\" program: %s\n", argv[0], 139 | strerror(errno)); 140 | exit(errno); 141 | } else if (pid < 0) { 142 | /* 143 | * Error - can't fork! 144 | */ 145 | 146 | perror("epm: fork failed"); 147 | return (1); 148 | } 149 | 150 | /* 151 | * Fork successful - wait for the child and return the error status... 152 | */ 153 | 154 | if (wait(&status) != pid) { 155 | fputs("epm: Got exit status from wrong program!\n", stderr); 156 | return (1); 157 | } else if (WIFSIGNALED(status)) 158 | return (-WTERMSIG(status)); 159 | else 160 | return (WEXITSTATUS(status)); 161 | } 162 | -------------------------------------------------------------------------------- /setup.fl: -------------------------------------------------------------------------------- 1 | # data file for the Fltk User Interface Designer (fluid) 2 | version 1.0304 3 | header_name {.h} 4 | code_name {.cxx} 5 | Function {make_window()} {open 6 | } { 7 | Fl_Window SetupWindow { 8 | label Install 9 | callback {if (CancelButton->active()) 10 | exit(0);} open 11 | xywh {167 45 640 330} type Double 12 | code0 {\#include "gui-common.h"} visible 13 | } { 14 | Fl_Box {Title[0]} { 15 | label Welcome 16 | xywh {10 10 130 25} labelfont 1 align 20 17 | } 18 | Fl_Box {Title[1]} { 19 | label {Install Type} 20 | xywh {10 35 130 25} labelfont 1 align 20 deactivate 21 | } 22 | Fl_Box {Title[2]} { 23 | label {Select Software} 24 | xywh {10 60 130 25} labelfont 1 align 20 deactivate 25 | } 26 | Fl_Box {Title[3]} { 27 | label Confirm 28 | xywh {10 85 130 25} labelfont 1 align 20 deactivate 29 | } 30 | Fl_Box {Title[4]} { 31 | label License 32 | xywh {10 110 130 25} labelfont 1 align 20 deactivate 33 | } 34 | Fl_Box {Title[5]} { 35 | label Installing 36 | xywh {10 135 130 25} labelfont 1 align 20 deactivate 37 | } 38 | Fl_Wizard Wizard {open 39 | xywh {150 10 480 275} box THIN_DOWN_BOX color 48 40 | } { 41 | Fl_Group {Pane[0]} {open 42 | xywh {150 10 480 275} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 43 | } { 44 | Fl_Help_View ReadmeFile { 45 | xywh {170 30 440 235} 46 | } 47 | } 48 | Fl_Group {Pane[1]} { 49 | xywh {150 10 480 275} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 50 | } { 51 | Fl_Box {} { 52 | label {Select the installation type:} 53 | xywh {170 30 440 25} align 148 54 | } 55 | Fl_Group {} { 56 | xywh {170 65 440 200} 57 | } { 58 | Fl_Round_Button {TypeButton[0]} { 59 | callback type_cb 60 | xywh {170 65 440 25} type Radio down_box ROUND_DOWN_BOX 61 | } 62 | Fl_Round_Button {TypeButton[1]} { 63 | callback type_cb 64 | xywh {170 90 440 25} type Radio down_box ROUND_DOWN_BOX 65 | } 66 | Fl_Round_Button {TypeButton[2]} { 67 | callback type_cb 68 | xywh {170 115 440 25} type Radio down_box ROUND_DOWN_BOX 69 | } 70 | Fl_Round_Button {TypeButton[3]} { 71 | callback type_cb 72 | xywh {170 140 440 25} type Radio down_box ROUND_DOWN_BOX 73 | } 74 | Fl_Round_Button {TypeButton[4]} { 75 | callback type_cb 76 | xywh {170 165 440 25} type Radio down_box ROUND_DOWN_BOX 77 | } 78 | Fl_Round_Button {TypeButton[5]} { 79 | callback type_cb 80 | xywh {170 190 440 25} type Radio down_box ROUND_DOWN_BOX 81 | } 82 | Fl_Round_Button {TypeButton[6]} { 83 | callback type_cb 84 | xywh {170 215 440 25} type Radio down_box ROUND_DOWN_BOX 85 | } 86 | Fl_Round_Button {TypeButton[7]} { 87 | callback type_cb 88 | xywh {170 240 440 25} type Radio down_box ROUND_DOWN_BOX 89 | } 90 | } 91 | } 92 | Fl_Group {Pane[2]} { 93 | xywh {150 10 480 275} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 94 | } { 95 | Fl_Box {} { 96 | label {Select the software you want to install:} 97 | xywh {170 30 440 25} align 148 98 | } 99 | Fl_Check_Browser SoftwareList { 100 | label { Available Software:} 101 | callback list_cb 102 | xywh {170 85 440 145} type Multi box DOWN_BOX selection_color 7 labelfont 1 align 5 when 3 103 | } 104 | Fl_Box SoftwareSize { 105 | label {0k marked for installation.} 106 | xywh {170 235 241 35} align 212 107 | } 108 | Fl_Button InstallAllButton { 109 | label {Install All} 110 | callback {SoftwareList->check_all(); 111 | list_cb(0,0);} 112 | xywh {421 240 80 25} 113 | } 114 | Fl_Button InstallNoneButton { 115 | label {Install None} 116 | callback {SoftwareList->check_none(); 117 | list_cb(0,0);} 118 | xywh {511 240 99 25} 119 | } 120 | } 121 | Fl_Group {Pane[3]} {open 122 | xywh {150 10 480 275} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 123 | } { 124 | Fl_Box {} { 125 | label {Confirm your software selections below:} 126 | xywh {170 30 440 25} align 148 127 | } 128 | Fl_Browser ConfirmList { 129 | label {Selected Software:} 130 | xywh {170 85 440 180} labelfont 1 align 5 131 | } 132 | } 133 | Fl_Group {Pane[4]} {open 134 | xywh {150 10 480 275} labelfont 1 labelsize 18 labelcolor 4 align 21 135 | } { 136 | Fl_Help_View LicenseFile { 137 | label {License Agreement:} 138 | xywh {170 48 440 192} labelfont 1 align 5 resizable 139 | } 140 | Fl_Group {} {open 141 | xywh {170 240 400 35} 142 | } { 143 | Fl_Round_Button LicenseAccept { 144 | label {Accept agreement and install} 145 | callback {NextButton->activate();} 146 | xywh {210 250 210 25} type Radio down_box ROUND_DOWN_BOX align 148 147 | } 148 | Fl_Round_Button LicenseDecline { 149 | label {Cancel installation} 150 | callback {NextButton->activate();} 151 | xywh {430 250 140 25} type Radio down_box ROUND_DOWN_BOX 152 | } 153 | } 154 | } 155 | Fl_Group {Pane[5]} {open 156 | xywh {150 10 480 275} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 157 | } { 158 | Fl_Progress InstallPercent { 159 | label {Progress Label...} 160 | xywh {170 47 440 15} color 48 selection_color 221 align 5 161 | } 162 | Fl_Browser InstallLog { 163 | xywh {170 74 440 191} 164 | } 165 | } 166 | } 167 | Fl_Box WelcomeImage {selected 168 | image {default.png} xywh {10 190 130 130} align 22 169 | } 170 | Fl_Button PrevButton { 171 | label {@-2< Back} 172 | callback {Wizard->prev(); 173 | 174 | int i; 175 | 176 | for (i = 0; i < 6; i ++) 177 | { 178 | Title[i]->activate(); 179 | 180 | if (Pane[i]->visible()) 181 | break; 182 | } 183 | 184 | for (i ++; i < 6; i ++) 185 | Title[i]->deactivate();} 186 | xywh {396 295 72 25} 187 | } 188 | Fl_Button NextButton { 189 | label {Next @-2>} 190 | callback next_cb 191 | xywh {478 295 74 25} 192 | } 193 | Fl_Button CancelButton { 194 | label Cancel 195 | callback {exit(0);} 196 | xywh {562 295 68 25} 197 | } 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /setup.h: -------------------------------------------------------------------------------- 1 | // generated by Fast Light User Interface Designer (fluid) version 1.0304 2 | 3 | #ifndef setup_h 4 | #define setup_h 5 | #include "gui-common.h" 6 | #include 7 | #include 8 | extern Fl_Double_Window *SetupWindow; 9 | #include 10 | extern Fl_Box *Title[6]; 11 | #include 12 | extern Fl_Wizard *Wizard; 13 | #include 14 | #include 15 | extern Fl_Help_View *ReadmeFile; 16 | #include 17 | extern void type_cb(Fl_Round_Button *, void *); 18 | extern Fl_Round_Button *TypeButton[8]; 19 | #include 20 | extern void list_cb(Fl_Check_Browser *, void *); 21 | extern Fl_Check_Browser *SoftwareList; 22 | extern Fl_Box *SoftwareSize; 23 | #include 24 | extern Fl_Button *InstallAllButton; 25 | extern Fl_Button *InstallNoneButton; 26 | #include 27 | extern Fl_Browser *ConfirmList; 28 | extern Fl_Help_View *LicenseFile; 29 | extern Fl_Round_Button *LicenseAccept; 30 | extern Fl_Round_Button *LicenseDecline; 31 | extern Fl_Group *Pane[6]; 32 | #include 33 | extern Fl_Progress *InstallPercent; 34 | extern Fl_Browser *InstallLog; 35 | extern Fl_Box *WelcomeImage; 36 | extern Fl_Button *PrevButton; 37 | extern void next_cb(Fl_Button *, void *); 38 | extern Fl_Button *NextButton; 39 | extern Fl_Button *CancelButton; 40 | Fl_Double_Window *make_window(); 41 | #endif 42 | -------------------------------------------------------------------------------- /slackware.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Slackware package gateway for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 2003-2017 by Michael R Sweet 6 | * Copyright 2003-2010 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epm.h" 26 | 27 | /* 28 | * Local functions... 29 | */ 30 | 31 | static int make_subpackage(const char *prodname, const char *directory, 32 | const char *platname, dist_t *dist, const char *subpackage); 33 | 34 | /* 35 | * 'make_slackware()' - Make a Slackware software distribution packages. 36 | */ 37 | 38 | int /* O - 0 = success, 1 = fail */ 39 | make_slackware(const char *prodname, /* I - Product short name */ 40 | const char *directory, /* I - Directory for distribution files */ 41 | const char *platname, /* I - Platform name */ 42 | dist_t *dist, /* I - Distribution information */ 43 | struct utsname *platform) /* I - Platform information */ 44 | { 45 | int i; /* Looping var */ 46 | 47 | REF(platform); 48 | 49 | /* 50 | * Check to see if we are being run as root... 51 | */ 52 | 53 | if (getuid()) { 54 | fprintf(stderr, "ERROR: Can only make Slackware packages as root\n"); 55 | return (1); 56 | } 57 | 58 | /* 59 | * Create subpackages... 60 | */ 61 | 62 | if (make_subpackage(prodname, directory, platname, dist, NULL)) 63 | return (1); 64 | 65 | for (i = 0; i < dist->num_subpackages; i++) 66 | if (make_subpackage(prodname, directory, platname, dist, dist->subpackages[i])) 67 | return (1); 68 | 69 | return (0); 70 | } 71 | 72 | /* 73 | * 'make_subpackage()' - Make a Slackware subpackage. 74 | */ 75 | 76 | static int /* O - 0 = success, 1 = fail */ 77 | make_subpackage(const char *prodname, /* I - Product short name */ 78 | const char *directory, /* I - Directory for distribution files */ 79 | const char *platname, /* I - Platform name */ 80 | dist_t *dist, /* I - Distribution information */ 81 | const char *subpackage) /* I - Subpackage name */ 82 | { 83 | int i; /* Looping var */ 84 | FILE *fp; /* Spec file */ 85 | char prodfull[1024], /* Full name of product */ 86 | filename[1024], /* Destination filename */ 87 | pkgname[1024]; /* Package filename */ 88 | file_t *file; /* Current distribution file */ 89 | command_t *c; /* Current command */ 90 | struct passwd *pwd; /* Pointer to user record */ 91 | struct group *grp; /* Pointer to group record */ 92 | struct utsname platform; /* Original platform data */ 93 | 94 | /* 95 | * Figure out the full product name... 96 | */ 97 | 98 | if (subpackage) 99 | snprintf(prodfull, sizeof(prodfull), "%s-%s", prodname, subpackage); 100 | else 101 | strlcpy(prodfull, prodname, sizeof(prodfull)); 102 | 103 | if (Verbosity) 104 | printf("Creating Slackware %s pkg distribution...\n", prodfull); 105 | 106 | /* 107 | * Slackware uses the real machine type in its package names... 108 | */ 109 | 110 | if (uname(&platform)) { 111 | fprintf(stderr, "ERROR: Can't get platform information: %s\n", strerror(errno)); 112 | 113 | return (1); 114 | } 115 | 116 | snprintf(pkgname, sizeof(pkgname), "%s-%s-%s-%s.tgz", prodfull, dist->version, 117 | platform.machine, dist->release); 118 | 119 | /* 120 | * Make a copy of the distribution files... 121 | */ 122 | 123 | if (Verbosity) 124 | puts("Copying temporary distribution files..."); 125 | 126 | for (i = dist->num_files, file = dist->files; i > 0; i--, file++) { 127 | /* 128 | * Check subpackage... 129 | */ 130 | 131 | if (file->subpackage != subpackage) 132 | continue; 133 | 134 | /* 135 | * Find the user and group IDs... 136 | */ 137 | 138 | pwd = getpwnam(file->user); 139 | grp = getgrnam(file->group); 140 | 141 | endpwent(); 142 | endgrent(); 143 | 144 | /* 145 | * Copy the file, make the directory, or make the symlink as needed... 146 | */ 147 | 148 | switch (tolower(file->type)) { 149 | case 'c': 150 | case 'f': 151 | snprintf(filename, sizeof(filename), "%s/%s%s", directory, prodfull, 152 | file->dst); 153 | 154 | if (Verbosity > 1) 155 | printf("F %s -> %s...\n", file->src, filename); 156 | 157 | if (copy_file(filename, file->src, file->mode, pwd ? pwd->pw_uid : 0, 158 | grp ? grp->gr_gid : 0)) 159 | return (1); 160 | break; 161 | 162 | case 'i': 163 | snprintf(filename, sizeof(filename), "%s/%s/etc/rc.d/%s", directory, prodfull, 164 | file->dst); 165 | 166 | if (Verbosity > 1) 167 | printf("I %s -> %s...\n", file->src, filename); 168 | 169 | if (copy_file(filename, file->src, file->mode, pwd ? pwd->pw_uid : 0, 170 | grp ? grp->gr_gid : 0)) 171 | return (1); 172 | break; 173 | 174 | case 'd': 175 | snprintf(filename, sizeof(filename), "%s/%s%s", directory, prodfull, 176 | file->dst); 177 | 178 | if (Verbosity > 1) 179 | printf("D %s...\n", filename); 180 | 181 | make_directory(filename, file->mode, pwd ? pwd->pw_uid : 0, 182 | grp ? grp->gr_gid : 0); 183 | break; 184 | 185 | case 'l': 186 | snprintf(filename, sizeof(filename), "%s/%s%s", directory, prodfull, 187 | file->dst); 188 | 189 | if (Verbosity > 1) 190 | printf("L %s -> %s...\n", file->src, filename); 191 | 192 | make_link(filename, file->src); 193 | break; 194 | } 195 | } 196 | 197 | /* 198 | * Write descriptions and post-install commands as needed... 199 | */ 200 | 201 | for (i = 0; i < dist->num_descriptions; i++) 202 | if (dist->descriptions[i].subpackage == subpackage) 203 | break; 204 | 205 | if (i < dist->num_descriptions) { 206 | snprintf(filename, sizeof(filename), "%s/%s/install", directory, prodfull); 207 | make_directory(filename, 0755, 0, 0); 208 | 209 | strlcat(filename, "/slack-desc", sizeof(filename)); 210 | 211 | if ((fp = fopen(filename, "w")) == NULL) { 212 | fprintf(stderr, 213 | "ERROR: Couldn't create Slackware description file \"%s\": %s\n", 214 | filename, strerror(errno)); 215 | return (1); 216 | } 217 | 218 | fprintf(fp, "%s: %s\n%s:\n", prodfull, dist->product, prodfull); 219 | 220 | for (; i < dist->num_descriptions; i++) 221 | if (dist->descriptions[i].subpackage == subpackage) 222 | fprintf(fp, "%s: %s\n", prodfull, dist->descriptions[i].description); 223 | 224 | fprintf(fp, "%s:\n", prodfull); 225 | fprintf(fp, "%s: (Vendor: %s, Packager: %s)\n", prodfull, dist->vendor, 226 | dist->packager); 227 | fprintf(fp, "%s:\n", prodfull); 228 | 229 | fclose(fp); 230 | } 231 | 232 | for (i = 0, c = dist->commands; i < dist->num_commands; i++, c++) 233 | if (c->subpackage == subpackage) 234 | break; 235 | 236 | if (i < dist->num_commands) { 237 | snprintf(filename, sizeof(filename), "%s/%s/install", directory, prodfull); 238 | make_directory(filename, 0755, 0, 0); 239 | 240 | strlcat(filename, "/doinst.sh", sizeof(filename)); 241 | 242 | if (!(fp = fopen(filename, "w"))) { 243 | fprintf(stderr, "ERROR: Couldn't create post install script \"%s\": %s\n", 244 | filename, strerror(errno)); 245 | return (1); 246 | } 247 | 248 | fputs("#!/bin/sh\n", fp); 249 | 250 | for (i = 0, c = dist->commands; i < dist->num_commands; i++, c++) 251 | if (c->subpackage == subpackage) { 252 | switch (c->type) { 253 | case COMMAND_PRE_INSTALL: 254 | fputs("WARNING: Package contains pre-install commands which are not " 255 | "supported\n" 256 | " by the Slackware packager.\n", 257 | stderr); 258 | break; 259 | 260 | case COMMAND_POST_INSTALL: 261 | fprintf(fp, "%s\n", c->command); 262 | break; 263 | 264 | case COMMAND_PRE_REMOVE: 265 | fputs("WARNING: Package contains pre-removal commands which are not " 266 | "supported\n" 267 | " by the Slackware packager.\n", 268 | stderr); 269 | break; 270 | 271 | case COMMAND_POST_REMOVE: 272 | fputs("WARNING: Package contains post-removal commands which are not " 273 | "supported\n" 274 | " by the Slackware packager.\n", 275 | stderr); 276 | break; 277 | } 278 | } 279 | 280 | fclose(fp); 281 | } 282 | 283 | /* 284 | * Remove any existing package of the same name, then create the 285 | * package... 286 | */ 287 | 288 | snprintf(filename, sizeof(filename), "%s/%s", directory, pkgname); 289 | unlink(filename); 290 | 291 | if (Verbosity) 292 | puts("Building Slackware package..."); 293 | 294 | snprintf(filename, sizeof(filename), "%s/%s", directory, prodfull); 295 | 296 | if (run_command(filename, "makepkg --linkadd y --chown n ../%s", pkgname)) 297 | return (1); 298 | 299 | /* 300 | * Remove temporary files... 301 | */ 302 | 303 | if (!KeepFiles) { 304 | if (Verbosity) 305 | puts("Removing temporary distribution files..."); 306 | 307 | unlink_directory(filename); 308 | } 309 | 310 | return (0); 311 | } 312 | -------------------------------------------------------------------------------- /snprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * snprintf functions for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2005 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epmstring.h" 26 | #include 27 | #include 28 | 29 | #ifndef HAVE_VSNPRINTF 30 | /* 31 | * 'vsnprintf()' - Format a string into a fixed size buffer. 32 | */ 33 | 34 | int /* O - Number of bytes formatted */ 35 | epm_vsnprintf(char *buffer, /* O - Output buffer */ 36 | size_t bufsize, /* O - Size of output buffer */ 37 | const char *format, /* I - printf-style format string */ 38 | va_list ap) /* I - Pointer to additional arguments */ 39 | { 40 | char *bufptr, /* Pointer to position in buffer */ 41 | *bufend, /* Pointer to end of buffer */ 42 | sign, /* Sign of format width */ 43 | size, /* Size character (h, l, L) */ 44 | type; /* Format type character */ 45 | const char *bufformat; /* Start of format */ 46 | int width, /* Width of field */ 47 | prec; /* Number of characters of precision */ 48 | char tformat[100], /* Temporary format string for sprintf() */ 49 | temp[1024]; /* Buffer for formatted numbers */ 50 | char *s; /* Pointer to string */ 51 | int slen; /* Length of string */ 52 | 53 | /* 54 | * Loop through the format string, formatting as needed... 55 | */ 56 | 57 | bufptr = buffer; 58 | bufend = buffer + bufsize - 1; 59 | 60 | while (*format && bufptr < bufend) { 61 | if (*format == '%') { 62 | bufformat = format; 63 | format++; 64 | 65 | if (*format == '%') { 66 | *bufptr++ = *format++; 67 | continue; 68 | } else if (strchr(" -+#\'", *format)) 69 | sign = *format++; 70 | else 71 | sign = 0; 72 | 73 | width = 0; 74 | while (isdigit(*format)) 75 | width = width * 10 + *format++ - '0'; 76 | 77 | if (*format == '.') { 78 | format++; 79 | prec = 0; 80 | 81 | while (isdigit(*format)) 82 | prec = prec * 10 + *format++ - '0'; 83 | } else 84 | prec = -1; 85 | 86 | if (*format == 'l' && format[1] == 'l') { 87 | size = 'L'; 88 | format += 2; 89 | } else if (*format == 'h' || *format == 'l' || *format == 'L') 90 | size = *format++; 91 | 92 | if (!*format) 93 | break; 94 | 95 | type = *format++; 96 | 97 | switch (type) { 98 | case 'E': /* Floating point formats */ 99 | case 'G': 100 | case 'e': 101 | case 'f': 102 | case 'g': 103 | if ((format - bufformat + 1) > sizeof(tformat) || 104 | (width + 2) > sizeof(temp)) 105 | break; 106 | 107 | strlcpy(tformat, bufformat, format - bufformat + 1); 108 | 109 | sprintf(temp, tformat, va_arg(ap, double)); 110 | 111 | if ((bufptr + strlen(temp)) > bufend) { 112 | strncpy(bufptr, temp, bufend - bufptr); 113 | bufptr = bufend; 114 | break; 115 | } else { 116 | strcpy(bufptr, temp); 117 | bufptr += strlen(temp); 118 | } 119 | break; 120 | 121 | case 'B': /* Integer formats */ 122 | case 'X': 123 | case 'b': 124 | case 'd': 125 | case 'i': 126 | case 'o': 127 | case 'u': 128 | case 'x': 129 | if ((format - bufformat + 1) > sizeof(tformat) || 130 | (width + 2) > sizeof(temp)) 131 | break; 132 | 133 | strlcpy(tformat, bufformat, format - bufformat + 1); 134 | 135 | sprintf(temp, tformat, va_arg(ap, int)); 136 | 137 | if ((bufptr + strlen(temp)) > bufend) { 138 | strncpy(bufptr, temp, bufend - bufptr); 139 | bufptr = bufend; 140 | break; 141 | } else { 142 | strcpy(bufptr, temp); 143 | bufptr += strlen(temp); 144 | } 145 | break; 146 | 147 | case 'p': /* Pointer value */ 148 | if ((format - bufformat + 1) > sizeof(tformat) || 149 | (width + 2) > sizeof(temp)) 150 | break; 151 | 152 | strlcpy(tformat, bufformat, format - bufformat + 1); 153 | 154 | sprintf(temp, tformat, va_arg(ap, void *)); 155 | 156 | strlcpy(bufptr, temp, bufend - bufptr + 1); 157 | bufptr += strlen(bufptr); 158 | break; 159 | 160 | case 'c': /* Character or character array */ 161 | if (width <= 1) 162 | *bufptr++ = va_arg(ap, int); 163 | else { 164 | if ((bufptr + width) > bufend) 165 | width = bufend - bufptr; 166 | 167 | memcpy(bufptr, va_arg(ap, char *), width); 168 | bufptr += width; 169 | } 170 | break; 171 | 172 | case 's': /* String */ 173 | if ((s = va_arg(ap, char *)) == NULL) 174 | s = "(null)"; 175 | 176 | slen = strlen(s); 177 | if (slen > width && prec != width) 178 | width = slen; 179 | 180 | if ((bufptr + width) > bufend) 181 | width = bufend - bufptr; 182 | 183 | if (slen > width) 184 | slen = width; 185 | 186 | if (sign == '-') { 187 | strncpy(bufptr, s, slen); 188 | memset(bufptr + slen, ' ', width - slen); 189 | } else { 190 | memset(bufptr, ' ', width - slen); 191 | strncpy(bufptr + width - slen, s, slen); 192 | } 193 | 194 | bufptr += width; 195 | break; 196 | 197 | case 'n': /* Output number of chars so far */ 198 | if ((format - bufformat + 1) > sizeof(tformat) || 199 | (width + 2) > sizeof(temp)) 200 | break; 201 | 202 | strlcpy(tformat, bufformat, format - bufformat + 1); 203 | 204 | sprintf(temp, tformat, va_arg(ap, int)); 205 | 206 | strlcpy(bufptr, temp, bufend - bufptr + 1); 207 | bufptr += strlen(bufptr); 208 | break; 209 | } 210 | } else 211 | *bufptr++ = *format++; 212 | } 213 | 214 | /* 215 | * Nul-terminate the string and return the number of characters in it. 216 | */ 217 | 218 | *bufptr = '\0'; 219 | return (bufptr - buffer); 220 | } 221 | #endif /* !HAVE_VSNPRINT */ 222 | 223 | #ifndef HAVE_SNPRINTF 224 | /* 225 | * 'epm_snprintf()' - Format a string into a fixed size buffer. 226 | */ 227 | 228 | int /* O - Number of bytes formatted */ 229 | epm_snprintf(char *buffer, /* O - Output buffer */ 230 | size_t bufsize, /* O - Size of output buffer */ 231 | const char *format, /* I - printf-style format string */ 232 | ...) /* I - Additional arguments as needed */ 233 | { 234 | int bytes; /* Number of bytes formatted */ 235 | va_list ap; /* Pointer to additional arguments */ 236 | 237 | va_start(ap, format); 238 | bytes = vsnprintf(buffer, bufsize, format, ap); 239 | va_end(ap); 240 | 241 | return (bytes); 242 | } 243 | #endif /* !HAVE_SNPRINTF */ 244 | -------------------------------------------------------------------------------- /string.c: -------------------------------------------------------------------------------- 1 | /* 2 | * String functions for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2005 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epmstring.h" 26 | 27 | /* 28 | * 'epm_strdup()' - Duplicate a string. 29 | */ 30 | 31 | #ifndef HAVE_STRDUP 32 | char * /* O - New string pointer */ 33 | epm_strdup(const char *s) /* I - String to duplicate */ 34 | { 35 | char *t; /* New string pointer */ 36 | 37 | if (s == NULL) 38 | return (NULL); 39 | 40 | if ((t = malloc(strlen(s) + 1)) == NULL) 41 | return (NULL); 42 | 43 | return (strcpy(t, s)); 44 | } 45 | #endif /* !HAVE_STRDUP */ 46 | 47 | /* 48 | * 'epm_strcasecmp()' - Do a case-insensitive comparison. 49 | */ 50 | 51 | #ifndef HAVE_STRCASECMP 52 | int /* O - Result of comparison (-1, 0, or 1) */ 53 | epm_strcasecmp(const char *s, /* I - First string */ 54 | const char *t) /* I - Second string */ 55 | { 56 | while (*s != '\0' && *t != '\0') { 57 | if (tolower(*s) < tolower(*t)) 58 | return (-1); 59 | else if (tolower(*s) > tolower(*t)) 60 | return (1); 61 | 62 | s++; 63 | t++; 64 | } 65 | 66 | if (*s == '\0' && *t == '\0') 67 | return (0); 68 | else if (*s != '\0') 69 | return (1); 70 | else 71 | return (-1); 72 | } 73 | #endif /* !HAVE_STRCASECMP */ 74 | 75 | #ifndef HAVE_STRLCAT 76 | /* 77 | * 'epm_strlcat()' - Safely concatenate two strings. 78 | */ 79 | 80 | size_t /* O - Length of string */ 81 | epm_strlcat(char *dst, /* O - Destination string */ 82 | const char *src, /* I - Source string */ 83 | size_t size) /* I - Size of destination string buffer */ 84 | { 85 | size_t srclen; /* Length of source string */ 86 | size_t dstlen; /* Length of destination string */ 87 | 88 | /* 89 | * Figure out how much room is left... 90 | */ 91 | 92 | dstlen = strlen(dst); 93 | size -= dstlen + 1; 94 | 95 | if (!size) 96 | return (dstlen); /* No room, return immediately... */ 97 | 98 | /* 99 | * Figure out how much room is needed... 100 | */ 101 | 102 | srclen = strlen(src); 103 | 104 | /* 105 | * Copy the appropriate amount... 106 | */ 107 | 108 | if (srclen > size) 109 | srclen = size; 110 | 111 | memcpy(dst + dstlen, src, srclen); 112 | dst[dstlen + srclen] = '\0'; 113 | 114 | return (dstlen + srclen); 115 | } 116 | #endif /* !HAVE_STRLCAT */ 117 | 118 | #ifndef HAVE_STRLCPY 119 | /* 120 | * 'epm_strlcpy()' - Safely copy two strings. 121 | */ 122 | 123 | size_t /* O - Length of string */ 124 | epm_strlcpy(char *dst, /* O - Destination string */ 125 | const char *src, /* I - Source string */ 126 | size_t size) /* I - Size of destination string buffer */ 127 | { 128 | size_t srclen; /* Length of source string */ 129 | 130 | /* 131 | * Figure out how much room is needed... 132 | */ 133 | 134 | size--; 135 | 136 | srclen = strlen(src); 137 | 138 | /* 139 | * Copy the appropriate amount... 140 | */ 141 | 142 | if (srclen > size) 143 | srclen = size; 144 | 145 | memcpy(dst, src, srclen); 146 | dst[srclen] = '\0'; 147 | 148 | return (srclen); 149 | } 150 | #endif /* !HAVE_STRLCPY */ 151 | 152 | /* 153 | * 'epm_strncasecmp()' - Do a case-insensitive comparison on up to N chars. 154 | */ 155 | 156 | #ifndef HAVE_STRNCASECMP 157 | int /* O - Result of comparison (-1, 0, or 1) */ 158 | epm_strncasecmp(const char *s, /* I - First string */ 159 | const char *t, /* I - Second string */ 160 | size_t n) /* I - Maximum number of characters to compare */ 161 | { 162 | while (*s != '\0' && *t != '\0' && n > 0) { 163 | if (tolower(*s) < tolower(*t)) 164 | return (-1); 165 | else if (tolower(*s) > tolower(*t)) 166 | return (1); 167 | 168 | s++; 169 | t++; 170 | n--; 171 | } 172 | 173 | if (n == 0) 174 | return (0); 175 | else if (*s == '\0' && *t == '\0') 176 | return (0); 177 | else if (*s != '\0') 178 | return (1); 179 | else 180 | return (-1); 181 | } 182 | #endif /* !HAVE_STRNCASECMP */ 183 | -------------------------------------------------------------------------------- /support.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Support functions for the ESP Package Manager (EPM). 3 | * 4 | * Copyright © 2020 by Jim Jagielski 5 | * Copyright 1999-2014 by Michael R Sweet 6 | * Copyright 1999-2006 by Easy Software Products. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | /* 22 | * Include necessary headers... 23 | */ 24 | 25 | #include "epm.h" 26 | 27 | /* 28 | * 'get_vernumber()' - Convert a version string to a number... 29 | */ 30 | 31 | int /* O - Version number */ 32 | get_vernumber(const char *version) /* I - Version string */ 33 | { 34 | int numbers[4], /* Raw version numbers */ 35 | nnumbers, /* Number of numbers in version */ 36 | temp, /* Temporary version number */ 37 | offset; /* Offset for last version number */ 38 | const char *ptr; /* Pointer into string */ 39 | 40 | /* 41 | * Loop through the version number string and construct a version number. 42 | */ 43 | 44 | memset(numbers, 0, sizeof(numbers)); 45 | 46 | for (ptr = version; *ptr && !isdigit(*ptr & 255); ptr++) 47 | ; 48 | /* Skip leading letters, periods, etc. */ 49 | 50 | for (offset = 0, temp = 0, nnumbers = 0; *ptr && !isspace(*ptr & 255); ptr++) 51 | if (isdigit(*ptr & 255)) 52 | temp = temp * 10 + *ptr - '0'; 53 | else { 54 | /* 55 | * Add each mini version number (m.n.p) and patch/pre stuff... 56 | */ 57 | 58 | if (nnumbers < 4) { 59 | numbers[nnumbers] = temp; 60 | nnumbers++; 61 | } 62 | 63 | temp = 0; 64 | 65 | if (*ptr == '.') 66 | offset = 0; 67 | else if (*ptr == 'p' || *ptr == '-') { 68 | if (strncmp(ptr, "pre", 3) == 0) { 69 | ptr += 2; 70 | offset = -20; 71 | } else 72 | offset = 0; 73 | 74 | nnumbers = 3; 75 | } else if (*ptr == 'b') { 76 | offset = -50; 77 | nnumbers = 3; 78 | } else { /* if (*ptr == 'a') */ 79 | offset = -100; 80 | nnumbers = 3; 81 | } 82 | } 83 | 84 | if (nnumbers < 4) 85 | numbers[nnumbers] = temp; 86 | 87 | /* 88 | * Compute the version number as MMmmPPpp + offset 89 | */ 90 | 91 | return (((numbers[0] * 100 + numbers[1]) * 100 + numbers[2]) * 100 + numbers[3] + 92 | offset); 93 | } 94 | -------------------------------------------------------------------------------- /uninst.fl: -------------------------------------------------------------------------------- 1 | # data file for the Fltk User Interface Designer (fluid) 2 | version 1.0304 3 | header_name {.h} 4 | code_name {.cxx} 5 | Function {make_window()} {open 6 | } { 7 | Fl_Window UninstallWindow { 8 | label Uninstall 9 | callback {if (CancelButton->active()) 10 | exit(0);} open selected 11 | xywh {264 45 640 310} type Double 12 | code0 {\#include "gui-common.h"} visible 13 | } { 14 | Fl_Box {Title[0]} { 15 | label Welcome 16 | xywh {10 10 130 25} labelfont 1 align 20 17 | } 18 | Fl_Box {Title[1]} { 19 | label {Select Software} 20 | xywh {10 35 130 25} labelfont 1 align 20 deactivate 21 | } 22 | Fl_Box {Title[2]} { 23 | label Confirm 24 | xywh {10 60 130 25} labelfont 1 align 20 deactivate 25 | } 26 | Fl_Box {Title[3]} { 27 | label Removing 28 | xywh {10 85 130 25} labelfont 1 align 20 deactivate 29 | } 30 | Fl_Wizard Wizard {open 31 | xywh {150 10 480 255} box THIN_DOWN_BOX color 48 32 | } { 33 | Fl_Group {Pane[0]} {open 34 | xywh {150 10 480 255} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 35 | } { 36 | Fl_Help_View ReadmeFile { 37 | xywh {170 30 440 215} 38 | } 39 | } 40 | Fl_Group {Pane[1]} {open 41 | xywh {150 10 480 255} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 42 | } { 43 | Fl_Box {} { 44 | label {Select the software to remove:} 45 | xywh {170 30 440 25} align 148 46 | } 47 | Fl_Check_Browser SoftwareList { 48 | label { Installed Software:} 49 | callback list_cb 50 | xywh {170 83 440 127} type Multi box DOWN_BOX selection_color 7 labelfont 1 align 5 when 3 51 | } 52 | Fl_Box SoftwareSize { 53 | label {0k marked for removal.} 54 | xywh {170 215 220 35} align 212 55 | } 56 | Fl_Button RemoveAllButton { 57 | label {Remove All} 58 | callback {SoftwareList->check_all(); 59 | list_cb(0,0);} 60 | xywh {400 220 90 25} 61 | } 62 | Fl_Button RemoveNoneButton { 63 | label {Remove None} 64 | callback {SoftwareList->check_none(); 65 | list_cb(0,0);} 66 | xywh {500 220 110 25} 67 | } 68 | } 69 | Fl_Group {Pane[2]} {open 70 | xywh {150 10 480 255} labelfont 1 labelsize 18 labelcolor 4 align 21 hide 71 | } { 72 | Fl_Box {} { 73 | label {Confirm software selected for removal:} 74 | xywh {170 30 440 25} align 148 75 | } 76 | Fl_Browser ConfirmList { 77 | label {Software to Remove:} 78 | xywh {170 83 440 162} labelfont 1 align 5 79 | } 80 | } 81 | Fl_Group {Pane[3]} {open 82 | xywh {150 10 480 255} labelfont 1 labelsize 18 labelcolor 4 align 21 83 | } { 84 | Fl_Progress RemovePercent { 85 | label {Progress Label...} 86 | xywh {170 45 440 15} color 48 selection_color 221 align 5 87 | } 88 | Fl_Browser RemoveLog { 89 | xywh {170 70 440 175} 90 | } 91 | } 92 | } 93 | Fl_Box WelcomeImage { 94 | image {default.png} xywh {10 170 130 130} align 22 95 | } 96 | Fl_Button PrevButton { 97 | label {@-2< Back} 98 | callback {Wizard->prev(); 99 | int i; 100 | for (i = 0; i < 4; i ++) 101 | { 102 | Title[i]->activate(); 103 | 104 | if (Pane[i]->visible()) 105 | break; 106 | } 107 | 108 | for (i ++; i < 4; i ++) 109 | Title[i]->deactivate();} 110 | xywh {396 275 72 25} 111 | } 112 | Fl_Button NextButton { 113 | label {Next @-2>} 114 | callback next_cb 115 | xywh {478 275 74 25} 116 | } 117 | Fl_Button CancelButton { 118 | label Cancel 119 | callback {exit(0);} 120 | xywh {562 275 68 25} 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /uninst.h: -------------------------------------------------------------------------------- 1 | // generated by Fast Light User Interface Designer (fluid) version 1.0304 2 | 3 | #ifndef uninst_h 4 | #define uninst_h 5 | #include "gui-common.h" 6 | #include 7 | #include 8 | extern Fl_Double_Window *UninstallWindow; 9 | #include 10 | extern Fl_Box *Title[4]; 11 | #include 12 | extern Fl_Wizard *Wizard; 13 | #include 14 | #include 15 | extern Fl_Help_View *ReadmeFile; 16 | #include 17 | extern void list_cb(Fl_Check_Browser *, void *); 18 | extern Fl_Check_Browser *SoftwareList; 19 | extern Fl_Box *SoftwareSize; 20 | #include 21 | extern Fl_Button *RemoveAllButton; 22 | extern Fl_Button *RemoveNoneButton; 23 | #include 24 | extern Fl_Browser *ConfirmList; 25 | extern Fl_Group *Pane[4]; 26 | #include 27 | extern Fl_Progress *RemovePercent; 28 | extern Fl_Browser *RemoveLog; 29 | extern Fl_Box *WelcomeImage; 30 | extern Fl_Button *PrevButton; 31 | extern void next_cb(Fl_Button *, void *); 32 | extern Fl_Button *NextButton; 33 | extern Fl_Button *CancelButton; 34 | Fl_Double_Window *make_window(); 35 | #endif 36 | --------------------------------------------------------------------------------