Skip to content

Commit

Permalink
Fix Debian packages (now installs to /usr/local); add install instruc…
Browse files Browse the repository at this point in the history
…tions to README; consistent version naming; Update to Fedora33

- Fix Debian packages (now installs to /usr/local)
- Add install instructions to README
- Consistent version naming
- Update Fedora to 33
  • Loading branch information
rleh authored Mar 27, 2021
2 parents d4e659b + 1f50071 commit 6802725
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 40 deletions.
49 changes: 15 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
sudo apt-get update
sudo apt-get -y install \
make libtool pkg-config autoconf automake \
texinfo tree libusb-dev libusb-1.0 \
rsync texinfo tree libusb-dev libusb-1.0 \
libhidapi-dev libftdi-dev
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -57,7 +57,7 @@ jobs:
(cd openocd && ./bootstrap)
- name: "./configure"
run: |
(cd openocd && ./configure --prefix=/opt/openocd \
(cd openocd && ./configure --prefix=/usr/local \
--enable-ftdi --enable-stlink --enable-ti-icdi \
--enable-ulink --enable-usb-blaster-2 --enable-ft232r \
--enable-vsllink --enable-xds110 --enable-osbdm \
Expand All @@ -68,13 +68,13 @@ jobs:
- name: Make
run: (cd openocd && make -j8)
- name: Make install
run: (cd openocd && make install)
run: (cd openocd && sudo make install)
- name: Debian package
run: |
sed -i s/VERSION/${{ env.VERSION }}/g deb-package/DEBIAN/control
mkdir -p deb-package/opt/openocd
cp -r /opt/openocd/* deb-package/opt/openocd/
sudo chown -R root:root deb-package/opt/openocd/
mkdir -p deb-package
rsync -aR /usr/local/{bin/openocd,share/info/openocd*,share/man/*/openocd*,share/openocd/} deb-package/
sudo chown -R root:root deb-package/
dpkg-deb --build deb-package
- name: Test package installation
run: sudo apt-get -y install ./deb-package.deb
Expand Down Expand Up @@ -113,10 +113,10 @@ jobs:
sed -i s/VERSION/${{ env.VERSION }}/g ~/rpmbuild/SPECS/openocd.spec
- name: Clone OpenOCD repo and run Bootstrap
run: |
(git clone http://openocd.zylin.com/openocd.git openocd-master && cd openocd-master/ && ./bootstrap)
rm -rf openocd-master/.git/
zip -q -r ~/rpmbuild/SOURCES/openocd-master.zip openocd-master
rm -rf openocd-master/
(git clone http://openocd.zylin.com/openocd.git openocd-0.11.0 && cd openocd-0.11.0/ && ./bootstrap)
rm -rf openocd-0.11.0/.git/
zip -q -r ~/rpmbuild/SOURCES/openocd-0.11.0.zip openocd-0.11.0
rm -rf openocd-0.11.0/
- name: Build RPM from spec file
run: |
cd ~/rpmbuild/SPECS
Expand Down Expand Up @@ -162,9 +162,9 @@ jobs:
uname -a
echo ::set-output name=uname::$(uname -a)
apt-get update
apt-get -y install make libtool pkg-config autoconf automake texinfo tree libusb-dev libusb-1.0 libhidapi-dev libftdi-dev git build-essential
apt-get -y install make libtool pkg-config autoconf automake texinfo tree rsync libusb-dev libusb-1.0 libhidapi-dev libftdi-dev git build-essential
(git clone http://openocd.zylin.com/openocd.git && cd openocd && ./bootstrap)
(cd openocd && ./configure --prefix=/opt/openocd \
(cd openocd && ./configure --prefix=/usr/local \
--enable-ftdi --enable-stlink --enable-ti-icdi \
--enable-ulink --enable-usb-blaster-2 --enable-ft232r \
--enable-vsllink --enable-xds110 --enable-osbdm \
Expand All @@ -174,30 +174,11 @@ jobs:
--enable-openjtag --enable-jlink)
(cd openocd && make -j8)
(cd openocd && make install)
#cp openocd/contrib/60-openocd.rules /lib/udev/rules.d/60-openocd.rules
sed -i s/VERSION/${{ env.VERSION }}/g deb-package/DEBIAN/control
sed -i s/amd64/arm64/g deb-package/DEBIAN/control
mkdir -p deb-package/opt/openocd
cp -r /opt/openocd/* deb-package/opt/openocd/
chown -R root:root deb-package/opt/openocd/
#mkdir -p deb-package/lib/udev/rules.d
#mkdir -p deb-package/usr/bin
#mkdir -p deb-package/usr/share/doc/openocd
#mkdir -p deb-package/usr/share/doc-base
#mkdir -p deb-package/usr/share/info
#mkdir -p deb-package/usr/share/lintian/overrides
#mkdir -p deb-package/usr/share/man/man1
#mkdir -p deb-package/usr/share/metainfo
#mkdir -p deb-package/usr/share/openocd
#cp -r /lib/udev/rules.d/60-openocd.rules deb-package/lib/udev/rules.d/60-openocd.rules
#cp -r /usr/bin/openocd deb-package/usr/bin/openocd
#cp -r /usr/share/doc/openocd/* deb-package/usr/share/doc/openocd/
#cp -r /usr/share/doc-base/openocd deb-package/usr/share/doc-base/openocd
#cp -r /usr/share/info/openocd.* deb-package/usr/share/info/
#cp -r /usr/share/lintian/overrides/openocd deb-package/usr/share/lintian/overrides/openocd
#cp -r /usr/share/man/man1/openocd.1.gz deb-package/usr/share/man/man1/openocd.1.gz
#cp -r /usr/share/metainfo/org.openocd.metainfo.xml deb-package/usr/share/metainfo/org.openocd.metainfo.xml
#cp -r /usr/share/openocd/* deb-package/usr/share/openocd/
mkdir -p deb-package
rsync -aR /usr/local/{bin/openocd,share/info/openocd*,share/man/*/openocd*,share/openocd/} deb-package/
chown -R root:root deb-package
dpkg-deb --build deb-package
apt-get -y install ./deb-package.deb
Expand Down
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# Latest OpenOCD Builds

Automated weekly builds of the latest OpenOCD from http://openocd.zylin.com/openocd.git.
Automated builds of the latest OpenOCD from http://openocd.zylin.com/openocd.git.

## Installation

### Debian/Ubuntu

Download latest `*.deb` Package from [Releases](https://github.com/rleh/openocd-build/releases) (usually `*.amd64.deb` on x86 computers; `*.arm64.deb` is e.g. for Raspberry Pi).

```bash
# Install Package (replace the file name with the one you downloaded)
sudo dpkg -i openocd-master-20210327.0054.amd64.deb

# Install missing dependencies:
sudo apt install -f
```

### Fedora/CentOS/...

Download latest `*.rpm` Package from [Releases](https://github.com/rleh/openocd-build/releases).

```bash
# Install Package (replace the file name with the one you downloaded)
sudo dnf install openocd-master-20210327.0054.x86_64.rpm
```


## Usage

You can test the installation by letting OpenOCD display its version:

```bash
openocd --version
```
4 changes: 2 additions & 2 deletions deb-package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: openocd
Version: VERSION
Version: 0.11.0-master.VERSION
Architecture: amd64
Maintainer: Raphael Lehmann <raphael+openocdbuild@rleh.de>
Installed-Size: 5790
Depends: libc6 (>= 2.15), libftdi1-2 (>= 1.2), libhidapi-hidraw0 (>= 0.8.0~rc1+git20140201.3a66d4e+dfsg), libjaylink0, libjim0.79 (>= 0.73) | libjim0.77 (>= 0.73), libusb-0.1-4 (>= 2:0.1.12), libusb-1.0-0 (>= 2:1.0.16)
Depends: libc6 (>= 2.15), libftdi1 (>= 0.20-4), libhidapi-hidraw0 (>= 0.8.0~rc1+git20140201.3a66d4e+dfsg), libjaylink0, libjim0.79 (>= 0.73) | libjim0.77 (>= 0.73), libusb-0.1-4 (>= 2:0.1.12), libusb-1.0-0 (>= 2:1.0.16)
Section: embedded
Priority: optional
Homepage: http://openocd.sourceforge.net/
Expand Down
2 changes: 1 addition & 1 deletion docker-openocd-build-rpm-prerequisites/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:32
FROM fedora:33
LABEL maintainer="Raphael Lehmann <raphael+docker@rleh.de>"
LABEL Description="Image for building the upstream OpenOCD RPM package on Fedora"
WORKDIR /work
Expand Down
4 changes: 2 additions & 2 deletions rpm-package/openocd.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: openocd
Version: master
Release: VERSION
Version: 0.11.0
Release: master.VERSION
Summary: Debugging, in-system programming and boundary-scan testing for embedded devices

License: GPLv2
Expand Down

0 comments on commit 6802725

Please sign in to comment.