-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathJustfile
More file actions
133 lines (107 loc) · 4.02 KB
/
Justfile
File metadata and controls
133 lines (107 loc) · 4.02 KB
1
2
3
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
image_name := "localhost/krunner-bazaar:dev"
default: build
build-container:
#!/usr/bin/env bash
echo "Building development container image..."
podman build -t {{image_name}} -f Containerfile .
build: build-container
#!/usr/bin/env bash
set -euo pipefail
echo "Building krunner-bazaar..."
# Create build directory if it doesn't exist
mkdir -p build
# Build using development container
podman run --rm \
--userns=keep-id \
--volume "$(pwd):/workspace:Z" \
--workdir /workspace \
{{image_name}} \
bash -c '
set -euo pipefail
# Configure and build the project
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-/usr}
make -j$(nproc)
'
install: build
#!/usr/bin/env bash
set -euo pipefail
# Install using the development container with host system access
podman run --rm \
--userns=keep-id \
--volume "$(pwd):/workspace:Z" \
--workdir /workspace/build \
{{image_name}} \
bash -c '
# Install to host system
mkdir -p /workspace/build/prefix
make install DESTDIR=/workspace/build/prefix
'
tree build/prefix
sudo ostree admin unlock || true
sudo cp -v ./build/prefix/usr/lib64/qt6/plugins/kf6/krunner/bazaarrunner.so /usr/lib64/qt6/plugins/kf6/krunner/bazaarrunner.so
sudo cp -v ./build/prefix/usr/share/locale/es/LC_MESSAGES/plasma_runner_bazaarrunner.mo /usr/share/locale/es/LC_MESSAGES/plasma_runner_bazaarrunner.mo
gdb:
gdb -ex "run" -ex "bt" --args ./build/bin/bazaar-dbus-tool -s spotify
rpm: build-container
#!/usr/bin/env bash
set -euo pipefail
# Get project version from CMakeLists.txt or use default
VERSION=${VERSION:-1.0.0}
# Create RPM build structure
mkdir -p rpmbuild/{SOURCES,SPECS,BUILD,RPMS,SRPMS}
# Create source tarball
echo "Creating source tarball..."
git archive --format=tar.gz --prefix=krunner-bazaar-${VERSION}/ HEAD > rpmbuild/SOURCES/krunner-bazaar-${VERSION}.tar.gz
# Copy spec file
cp krunner-bazaar.spec rpmbuild/SPECS/
# Build RPM using development container
podman run --rm \
--userns=keep-id \
--volume "$(pwd):/workspace" \
--workdir /workspace \
{{image_name}} \
bash -c "
set -euo pipefail
# Build the RPM
rpmbuild --define '_topdir /workspace/rpmbuild' \
--define 'version ${VERSION}' \
-ba rpmbuild/SPECS/krunner-bazaar.spec
"
echo "RPM build complete!"
echo "Built packages:"
find rpmbuild/RPMS -name "*.rpm" -type f
find rpmbuild/SRPMS -name "*.rpm" -type f
bump-version version:
#!/usr/bin/env bash
set -euo pipefail
VERSION="{{version}}"
# Validate version format (should be like 1.2.3)
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: Version must be in format X.Y.Z (e.g., 1.2.3)"
exit 1
fi
echo "Bumping version to $VERSION..."
# Check if working directory is clean
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "Error: Working directory is not clean. Please commit or stash changes first."
git status --porcelain
exit 1
fi
# Update version in bazaarrunner.json
echo "Updating version in src/bazaarrunner.json..."
sed -i "s/\"Version\": \"[^\"]*\"/\"Version\": \"$VERSION\"/" src/bazaarrunner.json
# Verify the change was made
if ! grep -q "\"Version\": \"$VERSION\"" src/bazaarrunner.json; then
echo "Error: Failed to update version in bazaarrunner.json"
exit 1
fi
echo "Version updated successfully in bazaarrunner.json"
git diff src/bazaarrunner.json
git add src/bazaarrunner.json
git commit -m "chore: bump version to v$VERSION"
git push origin HEAD
git tag "v$VERSION"
git push origin "v$VERSION"