|
37 | 37 | ''; |
38 | 38 |
|
39 | 39 | installPhase = '' |
40 | | - mkdir -p $out/{lib,share/postgresql/extension} |
41 | | -
|
42 | | - # Install versioned library |
43 | | - install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} |
44 | | -
|
45 | | -
|
46 | | - if [[ "${version}" == "${latestVersion}" ]]; then |
47 | | - cp ${pname}.sql $out/share/postgresql/extension/${pname}--1.0.0.sql |
48 | | - # Install upgrade scripts |
49 | | - find . -name 'pg_cron--*--*.sql' -exec install -Dm644 {} $out/share/postgresql/extension/ \; |
50 | | - mv $out/share/postgresql/extension/pg_cron--1.0--1.1.sql $out/share/postgresql/extension/pg_cron--1.0.0--1.1.0.sql |
51 | | - mv $out/share/postgresql/extension/pg_cron--1.1--1.2.sql $out/share/postgresql/extension/pg_cron--1.1.0--1.2.0.sql |
52 | | - mv $out/share/postgresql/extension/pg_cron--1.2--1.3.sql $out/share/postgresql/extension/pg_cron--1.2.0--1.3.1.sql |
53 | | - mv $out/share/postgresql/extension/pg_cron--1.3--1.4.sql $out/share/postgresql/extension/pg_cron--1.3.1--1.4.2.sql |
54 | | - mv $out/share/postgresql/extension/pg_cron--1.4--1.4-1.sql $out/share/postgresql/extension/pg_cron--1.4.0--1.4.1.sql |
55 | | - mv $out/share/postgresql/extension/pg_cron--1.4-1--1.5.sql $out/share/postgresql/extension/pg_cron--1.4.2--1.5.2.sql |
56 | | - mv $out/share/postgresql/extension/pg_cron--1.5--1.6.sql $out/share/postgresql/extension/pg_cron--1.5.2--1.6.4.sql |
57 | | - fi |
58 | | -
|
59 | | - # Create versioned control file with modified module path |
60 | | - sed -e "/^default_version =/d" \ |
61 | | - -e "/^schema =/d" \ |
62 | | - -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ |
63 | | - ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control |
| 40 | + mkdir -p $out/{lib,share/postgresql/extension} |
| 41 | +
|
| 42 | + # Install versioned library |
| 43 | + install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} |
| 44 | +
|
| 45 | +
|
| 46 | + if [[ "${version}" == "${latestVersion}" ]]; then |
| 47 | + cp ${pname}.sql $out/share/postgresql/extension/${pname}--1.0.0.sql |
| 48 | + # Install upgrade scripts |
| 49 | + find . -name 'pg_cron--*--*.sql' -exec install -Dm644 {} $out/share/postgresql/extension/ \; |
| 50 | + mv $out/share/postgresql/extension/pg_cron--1.0--1.1.sql $out/share/postgresql/extension/pg_cron--1.0.0--1.1.0.sql |
| 51 | + mv $out/share/postgresql/extension/pg_cron--1.1--1.2.sql $out/share/postgresql/extension/pg_cron--1.1.0--1.2.0.sql |
| 52 | + mv $out/share/postgresql/extension/pg_cron--1.2--1.3.sql $out/share/postgresql/extension/pg_cron--1.2.0--1.3.1.sql |
| 53 | + mv $out/share/postgresql/extension/pg_cron--1.3--1.4.sql $out/share/postgresql/extension/pg_cron--1.3.1--1.4.2.sql |
| 54 | + mv $out/share/postgresql/extension/pg_cron--1.4--1.4-1.sql $out/share/postgresql/extension/pg_cron--1.4.0--1.4.1.sql |
| 55 | + mv $out/share/postgresql/extension/pg_cron--1.4-1--1.5.sql $out/share/postgresql/extension/pg_cron--1.4.2--1.5.2.sql |
| 56 | + mv $out/share/postgresql/extension/pg_cron--1.5--1.6.sql $out/share/postgresql/extension/pg_cron--1.5.2--1.6.4.sql |
| 57 | + fi |
| 58 | + cat > $out/share/postgresql/extension/pg_cron--1.6--1.6.4.sql << 'EOF' |
| 59 | + -- Version alignment migration |
| 60 | + -- Both 1.6 and 1.6.4 are actually the same version (1.6.4) |
| 61 | + -- This file exists only to allow smooth transition from the old naming scheme |
| 62 | + EOF |
| 63 | +
|
| 64 | + # Create versioned control file with modified module path |
| 65 | + sed -e "/^default_version =/d" \ |
| 66 | + -e "/^schema =/d" \ |
| 67 | + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ |
| 68 | + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control |
64 | 69 | ''; |
65 | 70 |
|
66 | 71 | meta = with lib; { |
|
0 commit comments