gdu
gdu copied to clipboard
RFE: Fedora / RHEL / CentOS package
I created a preliminary SPEC that will create a RPM that will install the precompiled package. I'll see if I can get a rpm that will build the source instead. gdu.txt
I make a tar.gz with the following name:
gdu_linux_amd64-5.3.0.tar.gz
And it contains a directory:
gdu-5.3.0/
gdu-5.3.0/gdu
I'll let you know if I get a working RPM that will build from Source instead.
Compiling the source fails because I am not pointing to the Go files as seen below:
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.i3M1EY
+ umask 022
+ cd /home/danie.dejager/rpmbuild/BUILD
+ cd gdu-5.3.0
+ go build -trimpath -buildmode=pie -mod=readonly -modcacherw -ldflags '-linkmode external -extldflags "" ' -o gdu
no Go files in /home/builduser/rpmbuild/BUILD/gdu-5.3.0
error: Bad exit status from /var/tmp/rpm-tmp.i3M1EY (%build)
This is the build command I use:
Name: gdu
go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-o %{name}
Contents of source after extracted:
Note: git on Centos 7 is too old and needs to be updated to satisfy the go build process. I updated git using this guide: https://computingforgeeks.com/how-to-install-latest-version-of-git-git-2-x-on-centos-7/
Thanks for diving into this!
This simple build command should work:
go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-o %{name} \
github.com/dundee/gdu/v5/cmd/gdu
It would be great to also add ldflags and disable CGO:
GO111MODULE=on CGO_ENABLED=0 go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags \
"-s -w \
-X 'github.com/dundee/gdu/v5/build.Version=$(git describe)' \
-X 'github.com/dundee/gdu/v5/build.User=$(id -u -n)' \
-X 'github.com/dundee/gdu/v5/build.Time=$(LC_ALL=en_US.UTF-8 date)'" \
-o %{name} \
github.com/dundee/gdu/v5/cmd/gdu
@dundee Do you require go 1.16 for building at minimum? Neither EL7 or EL8 comes with it standard. They're limited to 1.15 if using standard repos. Trying to build with go 1.15 failed with this:
internal/common/ui.go:4:2: package io/fs is not in GOROOT (/usr/lib/golang/src/io/fs)
I had no issues when I removed version 1.15 installed from EPEL and manually installed go 1.16 and tried with that instead.
I've created a SPEC that installs on EL7 and EL8. You will need to have go 1.16 installed and in path. gdu_5.3.0-2.spec.txt
To build on EL7 you'll also need to install a newer version of git.
pandoc is required and for EL8 found in powertools repo.
Name : gdu
Version : 5.3.0
Release : 2
Architecture: x86_64
Install Date: (not installed)
Group : Unspecified
Size : 6051276
License : MIT
Signature : (none)
Source RPM : gdu-5.3.0-2.src.rpm
Build Date : Thu 22 Jul 2021 23:12:10 SAST
Build Host : centos8.localdomain
Relocations : (not relocatable)
Packager : Danie de Jager
Vendor :
Summary : Pretty fast disk usage analyzer written in Go.
Description :
Pretty fast disk usage analyzer written in Go.
→ readelf -h /usr/bin/gdu
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x46dbe0
Start of program headers: 64 (bytes into file)
Start of section headers: 6055448 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 12
Size of section headers: 64 (bytes)
Number of section headers: 28
Section header string table index: 27
gdu-5.3.0-2.zip RPM and RPM SRC
Yes, go 1.16 is required, I use some incompatible changes introduced in this version.
Could we setup automatic building somewhere? For example on https://cbs.centos.org/koji/?
It won't be possible. There is not a go 1.16 available for RHEL 7 or 8 in EPEL , you will not be able to achieve your goal. EPEL packages may only be built against specific RH channels + EPEL. I'm trying COPR but not sure if that will work.
Ok, if it not works then we can probably wait until RHEL 9.
RHEL 9 is built from Fedora 34, which has 1.16, so you should be good there.
Can you publish the RPM above with your sources for now? I'll build a RPM when you release. This RPM works on EL6, 7 and 8.
Can you publish the RPM above with your sources for now? I'll build a RPM when you release. This RPM works on EL6, 7 and 8.
Yes, added to 5.3.0 release - https://github.com/dundee/gdu/releases/tag/v5.3.0
Could you build for 5.4.0 as well?
gdu-5.4.0.zip Here you go.
Thanks! Added to release files.
@dundee Here it is: gdu-5.5.0.zip
@dundee Here you go. BTW is the man file up-to-date? It is from Jan 2021. gdu-5.6.0.zip
@dundee Here you go. BTW is the man file up-to-date? It is from Jan 2021. gdu-5.6.0.zip
Thanks! Uploaded.
The man file was last changed on 20th Jul according to git history.
@dundee The date in the file stills says Jan 2021.
@dundee The date in the file stills says Jan 2021.
Ah, you are right, I have missed this one.
It will be fixed in next release.
@dundee Here is 5.6.1 gdu-5.6.1-1.zip
@dundee Here is 5.6.2 gdu-5.6.2-1.zip
Thanks!
@dundee Here is 5.7.0 gdu-5.7.0-1.zip
Thanks!
@dundee Here is 5.8.0 gdu-5.8.0-1.zip 0
Thanks!
@dundee Please pull the 5.8.0-1 version. There is something wrong with the build. I realised that no matter how it ends up version 5.7
https://github.com/dundee/gdu/v5/cmd/gdu does not resolve to a page anymore. Could that be the reason?
Ok, deleted.
The src package looks good to me, but the binary indeed contains version 5.7. Not sure why.
https://github.com/dundee/gdu/v5/cmd/gdu does not resolve to a page anymore. Could that be the reason?
I don't think so. This was never a page, only a module name.
@dundee this is the compile command.
GO111MODULE=on CGO_ENABLED=0 go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags \
"-s -w \
-X 'github.com/dundee/gdu/v5/build.Version=$(git describe)' \
-X 'github.com/dundee/gdu/v5/build.User=$(id -u -n)' \
-X 'github.com/dundee/gdu/v5/build.Time=$(LC_ALL=en_US.UTF-8 date)'" \
-o %{name} github.com/dundee/gdu/v5/cmd/gdu
Oh, I see the problem. The 5.8.0 tag is not annotated. Therefore git describe
will not show it.
I will have to release 5.8.1
I just saw the same thing. Thanks @dundee
@dundee I notice that pandoc complains
pandoc: Could not parse YAML header: UnexpectedEvent {_received = Just (EventMappingStart Nothing), _expected = Nothing}
I think that causes the man to render the header like this:
Here is the 5.8.1 rpm gdu-5.8.1.zip
There is now variable for date in the markdown source for man page: date: {{date}}
I would suggest to use gdu.1
, which is contained in the archive a not run pandoc (also remove it from build dependencies as well) at all. I have done the same in Arch package - https://aur.archlinux.org/cgit/aur.git/commit/?h=gdu&id=e3e0b7c48609200413ea88c5c3384bf70a25c803
Pandoc is huge and I am running it anyway for every release localy.
Thanks, added.
It won't be possible. There is not a go 1.16 available for RHEL 7 or 8 in EPEL , you will not be able to achieve your goal. EPEL packages may only be built against specific RH channels + EPEL. I'm trying COPR but not sure if that will work.
Do you think we can package for EPEL Next?
Added, thanks!
@dundee here is 5.10.0. gdu-5.10.0-1.zip
Thanks!
@dundee Here is 5.10.1 gdu-5.10.1-1.zip
Thank you!
@dundee Here is 5.11.0 gdu-5.11.0-1.zip
Thanks!
@dundee I created a new package for 5.11.0 compiled with go 1.17.4 gdu-5.11.0-2.zip
@daniejstriata Great! Uploaded.
@dundee Here is 5.12.0 gdu-5.12.0-1.zip
Hi @daniejstriata, could you pack 5.12.1?
@dundee Here you go. 5.12.1 gdu-5.12.1-1.zip
Thanks!
@dundee Here is 5.13.0 gdu-5.13.0-1.zip
Thank you!
@dundee Here is 5.13.1 gdu-5.13.1-1.zip
Added, thanks!
@dundee Here is 5.13.2 gdu-5.13.2-1.zip
Thanks!
@dundee Here is 5.14.0. Compiled with go 1.17.10. To add this in to EPEL gdu would need to build against go 1.17.5 gdu-5.14.0-1.zip
Thanks!
@dundee Not making progress adding gdu to Fedora. Will try to submit it again.
here is the latest RPM gdu-5.15.0-1.x86_64.zip
Thanks! I appreciate your grit.