Skip to content

Commit e858714

Browse files
committed
README: add one and tweaks; closes opnsense#891
1 parent 9896d2e commit e858714

File tree

2 files changed

+82
-12
lines changed

2 files changed

+82
-12
lines changed

Makefile

+12-4
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,22 @@ plist: force
184184
@${MAKE} -C ${.CURDIR}/lang plist
185185
@${MAKE} -C ${.CURDIR}/src plist
186186

187+
package-keywords: force
188+
@if [ ! -f /usr/ports/Keywords/sample.ucl ]; then \
189+
mkdir -p /usr/ports/Keywords; \
190+
cd /usr/ports/Keywords; \
191+
fetch https://raw.githubusercontent.com/opnsense/ports/master/Keywords/sample.ucl; \
192+
fi
193+
@echo ">>> Installed /usr/ports/Keywords/sample.ucl"
194+
187195
package: force
188196
@if [ -f ${WRKDIR}/.mount_done ]; then \
189-
echo "Cannot continue with live mount"; exit 1; \
197+
echo ">>> Cannot continue with live mount. Please run 'make umount'." >&2; \
198+
exit 1; \
190199
fi
191200
@if [ ! -f /usr/ports/Keywords/sample.ucl ]; then \
192-
mkdir -p /usr/ports/Keywords; \
193-
cd /usr/ports/Keywords; \
194-
fetch -q https://raw.githubusercontent.com/opnsense/ports/master/Keywords/sample.ucl; \
201+
echo ">>> Missing required file(s). Please run 'make package-keywords'" >&2; \
202+
exit 1; \
195203
fi
196204
@${PKG} info gettext-tools > /dev/null
197205
@${PKG} info git > /dev/null

README.md

+70-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ The OPNsense project invites developers to start contributing to
55
the code base. For your own purpose or even better to join us in
66
creating the best open source firewall available.
77

8-
The build process has been designed to make it truly straightforward
9-
and easy for anyone to build and code. Being able to get the sources
10-
and build it yourself is one of the key factors of open source software.
11-
12-
Although a lot of the code is still in flux, we try to publish the
13-
direction we're taking on our wiki page. The main outline of the new
14-
codebase is available at:
8+
The build process has been designed to make it easy for anyone to
9+
build and write code. The main outline of the new codebase is
10+
available at:
1511

1612
https://wiki.opnsense.org/index.php/Develop:Architecture
1713

@@ -23,7 +19,6 @@ Build tools
2319

2420
To create working software like OPNsense you need the sources and the
2521
tools to build it. The build tools for OPNsense are freely available.
26-
No strings attached.
2722

2823
Notes on how to build OPNsense can be found in the tools repository:
2924

@@ -46,3 +41,70 @@ http://opensource.org/licenses/BSD-2-Clause
4641
Every contribution made to the project must be licensed under the
4742
same conditions in order to keep OPNsense truly free and accessible
4843
for everybody.
44+
45+
Makefile targets
46+
================
47+
48+
The repository offers a couple of targets that either tie into
49+
tools.git build processes or are aimed at fast development.
50+
51+
make package
52+
------------
53+
54+
A package of the current state of the repository can be created using
55+
this target. It may require several packages to be installed. The
56+
target will try to assist in case of failure, e.g. when a missing file
57+
needs to be fetched from an external location.
58+
59+
Several OPTIONS exist to customise the package:
60+
61+
* CORE_DEPENDS: a list of required dependencies for the package
62+
* CORE_ORIGIN: sets a FreeBSD compatible package/ports origin
63+
* FLAVOUR: can be set to "OpenSSL" (default) or "LibreSSL"
64+
* CORE_COMMENT: a short description of the package
65+
* CORE_MAINTAINER: email of the package maintainer
66+
* CORE_WWW: web url of the package
67+
* CORE_NAME: sets a package name
68+
69+
Options are passed in the following form:
70+
71+
# make package CORE_NAME=my_new_name
72+
73+
make upgrade
74+
------------
75+
76+
Upgrade will run the package build and attempt to replace the currently
77+
installed package in the system. Safety measures may prevent the target
78+
from succeeding. The following rules apply:
79+
80+
In order to install from the master branch of this repository, the
81+
opnsense-devel package must be installed:
82+
83+
# pkg install opnsense-devel
84+
85+
In order to install from the stable branches of this repository, the
86+
opnsense-stable package must be installed:
87+
88+
# pkg install opnsense-stable
89+
90+
make mount
91+
----------
92+
93+
Live-mount the package into the current system. This will overlay
94+
the repository over /usr/local and will instantly change the GUI
95+
accordingly. In this mode changes can be quickly tested.
96+
97+
Note that live-mount will not be persistent after reboot and causes
98+
trouble when used while upgrading firmware as packages get installed
99+
into the repository as oppsed to the system. Use with care.
100+
101+
make umount
102+
-----------
103+
104+
Disable the live-mount feature.
105+
106+
make lint
107+
---------
108+
109+
Run serveral syntax checks on the repository. This is recommended
110+
before issuing a pull request on GitHub.

0 commit comments

Comments
 (0)