-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 1.24 KB
/
Makefile
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
RPM_DOCK_IMG=ffbuilder-rpm
RPM_DOCK_CTR=$(RPM_DOCK_IMG)c
# Entry point
build :: build-image patch
-@docker rm $(RPM_DOCK_CTR)
docker run -v $(PWD):/home/build --user="`id -u`:`id -g`" --name $(RPM_DOCK_CTR) $(RPM_DOCK_IMG) make ctr-build
# Run within docker to actually build the RPM
ctr-build::
cd FFmpeg && rpmbuild --define "_topdir `mktemp -d`" --build-in-place -bb ../ffmpeg.spec
# Re-build the list of RPMs needed for building
rpmlist :: build-image
-@docker rm $(RPM_DOCK_CTR)
docker run -v $(PWD):/home/build --name $(RPM_DOCK_CTR) $(RPM_DOCK_IMG) make ctr-rpmlist
# Run in docker and rebuild the list of RPMs needed for building
ctr-rpmlist ::
dnf -y builddep ffmpeg.spec
dnf repoquery --userinstalled --qf "%{name}" > rpmlist.txt
chown --reference=ffmpeg.spec rpmlist.txt
# Builds the docker image
build-image ::
docker build --pull --rm --tag $(RPM_DOCK_IMG) --file Dockerfile .
patch ::
cd FFmpeg && patch -p 1 -N < ../alternative_input.patch || true
clean ::
-@docker container rm --force $(RPM_DOCK_CTR)
-@rm -f dist/*.{rpm,tgz}
$(MAKE) -C FFmpeg clean
distclean :: clean
-@docker image rm --force $(RPM_DOCK_IMG)
-@docker image prune --force
-@docker container prune --force
-rm -rf FFmpeg/_doc
$(MAKE) -C FFmpeg distclean